1. Learn
  2. /
  3. Courses
  4. /
  5. Intro to Computational Finance with R

Exercise

An AR(1) model

Now consider the AR(1) model $$Y_t - 0.05 = \phi(Y_{t-1} - 0.05)$$ with \(|\phi| < 0\) and \(\epsilon_t ~ iid\) \(N(0,(0.1)^2)\).

Assume that \(\phi = 0.5\) and rewrite the code in such a way that it simulates data from the AR(1) model and that it displays the three corresponding graphs from the previous exercise correctly.

Instructions

100 XP
  • Assign to ar1_sim 250 observations simulated from the described AR(1) model.
  • Assign to acf_ar1_model the theoretical autocorrelations up to lag 10.
  • Create the three plot functions from the previous exercise but now for the AR(1) model instead of the MA(1) model. Have a look at the code of the previous exercise if you are unsure.