Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I get the matrix and the long run proportion. Unable to write the code. The programming has to be done in R. Preliminary: On any
I get the matrix and the long run proportion. Unable to write the code. The programming has to be done in R.
Preliminary: On any given day Eric is either cheerful (C), so-so (S), or glum (G). If he is cheerful today, then he will be C, S, or G tomorrow 0.2. If he is feeling so-so today, then he will be C, S, or G tomorrow with probabilities 0.3, 0.4, 0.3. If he is glum t with respective probabilities 0.5, 0.3, oday, then he will be C, S, or G tomorrow with probabilities 0.2, 0.2, 0.6 1. Write a one step transition matrix for the Eric's mood. Label the states 0, 1 and 2. 2. Find the long-run proportion for this process Simulation: Generate a sequence Xo, Xi, , X49,999 of the first 50, 000 states of Eric's mood chain and calculate the proportion of these times that the Markov chain is in each state. Use the following procedure: (a) Generate 50, 000 independent pseudo-random numbers (uniform numbers), by calcula- tor or computer. Each person should generate his or her own numbers. Print out the 40 first numbers. (b) Use the 1st random number to chose the initial state Xo at random (1/3 probability for each state). Remember that this is equivalent to generate a discrete random variable (see the first problem of simulation). This can be considered to be Eric's mood for day zero Write down this number (c) Generate Xn recursively, n = 1, 2, , 49, 999, by using the successive random numbers to generate successive states. For example, if X3 l then X4 should be chosen to be 0, 1, or 2 with probabilities 0.30, 0.40, and 0.30, respectively. List or print out the 40 values of the random variables (states), associating each state with the random number used to generate it (d) Compute the proportion of these 50, 000 days for which Eric's mood is in each of the 3 states. Compare this with the long-run proportions of the time in each state, obtained in the preliminary problem. For this comparison, it's enough to give the difference. (e) Print out your programStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started