Exercise

# Applying an MA Model

The bouncing of the stock price between bid and ask induces a negative first order autocorrelation, but no autocorrelations at lags higher than 1. You get the same ACF pattern with an MA(1) model. Therefore, you will fit an MA(1) model to the intraday stock data from the last exercise.

The first step is to compute minute-by-minute returns from the prices in `intraday`

, and plot the autocorrelation function. You should observe that the ACF looks like that for an MA(1) process. Then, fit the data to an MA(1), the same way you did for simulated data.

Instructions

**100 XP**

- Import
`plot_acf`

and`ARMA`

modules from statsmodels - Compute minute-to-minute returns from prices:
- Compute returns with the
`.pct_change()`

method - Use the pandas method
`.dropna()`

to drop the first row of returns, which is NaN

- Compute returns with the
- Plot the ACF function with lags up to 60 minutes
- Fit the returns data to an MA(1) model and print out the MA(1) parameter