![](https://crypto4nerd.com/wp-content/uploads/2023/06/0r8q2Rn6o-2gKlfN0-1024x683.jpeg)
Forecasting is a time-series technique used widely in industry to predict future trends based on past data. Forecasting is by far the most important and frequently used application of predictive analytics because it has a significant impact on both the top line and the bottom line of an organization.
Some examples of time-series forecasting:-
- Stock price analysis and stock price forecasting
- Weather forecasting
- Sales volume/revenue forecasting
Forecasting using ARMA (aka Auto regressive Moving average) is a popular method for time-series analysis and forecasting in many industries. ARMA models use regression and moving average components to capture underlying trends and patterns in time-series data to forecast future trends.
ARMA model is represented as an ARMA(p,q), where p represents the order of the autoregressive component and q represents the order of the moving average component.
The general form of the ARMA model equation could be represented as:
Y(t) = c + φ₁Y(t-1) + φ₂Y(t-2) + … + φₚY(t-p) + ε(t) + θ₁ε(t-1) + θ₂ε(t-2) + … + θ_qε(t-q)
Where:
- Y(t) represents the value of the time series at a time “t”.
- C is a constant term
- φ₁, φ₂, …, φₚ are the autoregressive parameters.
- ε(t) is the white noise term at a time “t”.
- θ₁, θ₂, …, θ_q are the moving average parameters.
ARMA model assumes that time-series data is already stationary which means the mean and variance of the time-series data is constant over some time.
Now, let’s look at the implementation of the ARMA model using Python:
# we will build combine model of AR(p) and MA(q) process to build ARMA model
from statsmodels.tsa.arima.model import ARIMAarima = ARIMA(vim_df.demand[0:30].astype(np.float64), order=(1,0,1))
arma_model = arima.fit()
arma_model.summary()
That’s it for this short blog on important topics to learn and master under unsupervised learning techniques.