Session Ready
Exercise

Generating ARMA data

In this exercise you will generate 100 days worth of AR/MA/ARMA data. Remember that in the real world applications, this data could be changes in Google stock prices, the energy requirements of New York City, or the number of cases of flu.

You can use the arma_generate_sample() function available in your workspace to generate time series using different AR and MA coefficients.

Remember for any model ARMA(p,q):

  • The list ar_coefs has the form [1, -a_1, -a_2, ..., -a_p].
  • The list ma_coefs has the form [1, m_1, m_2, ..., m_q],

where a_i are the lag-i AR coefficients and m_j are the lag-j MA coefficients.

Instructions 1/3
undefined XP
  • 1
    • Set ar_coefs and ma_coefs for an MA(1) model with MA lag-1 coefficient of -0.7.
    • Generate a time series of 100 values.
    • 2
      • Set the coefficients for an AR(2) model with AR lag-1 and lag-2 coefficients of 0.3 and 0.2 respectively.
    • 3
      • Set the coefficients for a model with form \(y_t = -0.2 y_{t-1} + 0.3 \epsilon_{t-1} + 0.4 \epsilon_{t-2} + \epsilon_t\).