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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!