hi I've tried your code, but it would still give me 100 simulations. I tried changing simulationESO = rep(NA,600) but it would still give only 100 results, and the other 500 would be NA.
to clarify my code, I have data x = c( "2", "-1", "2", "0", "1", "-2") that has states -2, -1, 0, 1, 2.
ESO is a probability transition matrix that also has states -2,-1,0,1,2.
When I set my initial state as "2", and when I used the codes above, it provided me with 100 simulations. (which is what I wanted)
however, I want the code to repeat the simulation if I set the initial state as according to x so that I get 100 simulations for "2", "-1", "2", "0", "1", "-2" so 600 simulations in total. I hope this clarifies this bit more.