jeudi 26 octobre 2017

Using the 1st random number to chose the initial state, X0, at random

I have this probability problem:

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 with respective probabilities 0.5, 0.3, 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 today, then he will be C, S, or G tomorrow with probabilities 0.2, 0.2, 0.6.

I have generated 50,000 independent pseudo-random numbers (uniform) in R and have printed out the first 40. Now, how do I use the 1st random number to chose the initial state X0 at random (1/3 probability for each state)? I know that this is equivalent to generating a discrete random variable, but I am still confused.




Aucun commentaire:

Enregistrer un commentaire