Question: Write a function called simulate_MC that takes as inputs: - a 1-d numpy array of size K called p - a KK transition matrix called
Write a function called simulate_MC that takes as inputs: - a 1-d numpy array of size K called p - a KK transition matrix called Q - a positive integer and outputs a 1-d array of size n called X which is a reatiotion of the Markov chain X0.X1,,,Xn1. You should use np.random.choice in your code. Note: Since other exercises below will rely on your simulate..MC code. it is very important that you get this right. In I It Code cell for Problen 1 - do not delete or nodify this line def simulate MC (,0,n) : return(x)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
