But at least now you know how to simulate autocorrelated processes. The code most of it is stolen from this website. But I encounter difficulty to generate the three correlated random number. You specify a probability, a mean and a standard deviation, and you get the values that you want: I rounded these numbers. Suggest improvement.
nest...