Skip to content

Instantly share code, notes, and snippets.

@baogorek
Created June 25, 2019 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baogorek/a50b72a48c33f3f6e1f09258cbcb91ed to your computer and use it in GitHub Desktop.
Save baogorek/a50b72a48c33f3f6e1f09258cbcb91ed to your computer and use it in GitHub Desktop.
non-invertible-ma-process.R
N <- 10000
theta <- 1.4
e <- rnorm(N)
e_lag <- c(NA, e[1:(N-1)])
y <- e - theta * e_lag
acf(y[2:N])
l = 5000 # how far back
y_far_back <- c(rep(NA, l), y[1:(N-l)])
summary(lm(y ~ y_far_back))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment