Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simulating Autocorrelated data via Monte Carlo

    Hello,

    I am trying to simulate autocorrelated data with P(x_t = x_t-1) = .5. I was trying to use something similar to the runiform() or rnormal() commands, but they don't allow for autocorrelation. For some reason, sim_arma is also not working for me.

    Thanks!

  • #2
    I don't know what sim_arma is or why it does not work, but you can use drawnorm with a correlation matrix of your choosing.

    Comment


    • #3
      Code:
      set obs 20
      gen dice = runiform()
      gen x = runiform() in 1
      replace x = runiform() * (dice < 0.5) + x[_n-1] * (dice > 0.5) in 2/l

      Comment

      Working...
      X