In [1]:

```
import numpy as np
import pandas as pd
import os
from statsmodels.tsa.statespace.sarimax import SARIMAX
from statsmodels.graphics.tsaplots import plot_acf,plot_pacf
from statsmodels.tsa.seasonal import seasonal_decompose
#from pmdarima import auto_arima
from sklearn.metrics import mean_squared_error
from statsmodels.tools.eval_measures import rmse
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as plt
%matplotlib inline
```

ARIMA is a model which is used for predicting future trends on a time series data. It is model that form of regression analysis.

**AR (Autoregression) :**Model that shows a changing variable that regresses on its own lagged/prior values.**I (Integrated) :**Differencing of raw observations to allow for the time series to become stationary**MA (Moving average) :**Dependency between an observation and a residual error from a moving average model

For ARIMA models, a standard notation would be ARIMA with p, d, and q, where integer values substitute for the parameters to indicate the type of ARIMA model used.

**p:**the number of lag observations in the model; also known as the lag order.**d:**the number of times that the raw observations are differenced; also known as the degree of differencing.**q:**the size of the moving average window; also known as the order of the moving average.

For more information about ARIMA you can check:

What is ARIMA

Autoregressive Integrated Moving Average (ARIMA)

In [14]:

```
arima_pred = arima_result.predict(start = len(train_data), end = len(df)-1, typ="levels").rename("ARIMA Predictions")
arima_pred
```

Out[14]:

1994-09-01 133.943955 1994-10-01 157.814451 1994-11-01 181.865146 1994-12-01 183.541331 1995-01-01 144.902539 1995-02-01 136.857294 1995-03-01 151.136283 1995-04-01 133.214691 1995-05-01 137.923012 1995-06-01 120.564847 1995-07-01 128.439705 1995-08-01 138.819035 Freq: MS, Name: ARIMA Predictions, dtype: float64

In [15]:

```
test_data['Monthly beer production'].plot(figsize = (16,5), legend=True)
arima_pred.plot(legend = True);
```

- time series forecasting arima lstm prophet
- arima and seasonal arima
- time series forecasting w arima sarima
- arima model for time series forecasting
- 1cac 4 stock price forecast with arima lstm
- time series forecasting arima v s lstm rnn
- time series for beginners with arima
- stock prediction major project
- time series forecasting with arima and lstm