type
Post
Created date
Jun 16, 2022 01:21 PM
category
Data Science
tags
Applied forecasting
Economics
status
Published
Language
From
summary
slug
password
Author
Priority
Featured
Featured
Cover
Origin
Type
URL
Youtube
Youtube
icon
We have learnt ARIMA and regression previously, but both have their advantage and disadvantage.
For ARIMA, it is univariate which means that it can be only performed on a single time series. So, say, the effects of holidays, competitor activity, changes in the law, the wider economy, or other external variables, may explain some of the historical variations and may lead to more accurate forecasts.
For regression, allows for the inclusion of a lot of relevant information from predictor variables, but does not allow for the subtle time series dynamics that can be handled with ARIMA models.
notion image

Solution : ARIMA models with allowing other information to be included - ARIMAX


 
 

Regression with ARIMA errors


In
👹
Regression model (Time Series) (RTS)
. we learnt this formula where we assumed to be WN. Now, we want the to be autocorrelated.
You always write it in two equations:
The first equation is the regression part so that part looks the same; it is just that the epsilon is replaced by a eta. The second part is a separate ARIMA model for
notion image
notion image
So there is still a WN in our model, but in the second part.

Estimation

notion image
 
notion image
Plotting the residual of the error
notion image
fit <- us_change %>% model( ARIMA(Consumption ~ Income) ) gg_tsresiduals(fit) ## this one ================================== OR this one residuals(fit, type = "innovation") %>% gg_tsdisplay(.resid, plot_type = "partial") + ggtitle("ARIMA errors")
Plotting the residual of the error
notion image
residuals(fit, type = "regression") %>% gg_tsdisplay(.resid, plot_type = "partial") + ggtitle("Regression errors")

Forecasting using dynamic regression

notion image
## predict 11 periods ahead us_change_future <- new_data(us_change, 11) %>% mutate( ## take the max of income as a scenario Income = max(us_change$Income), Savings = mean(us_change$Savings), Unemployment = mean(us_change$Unemployment) ) forecast(fit, new_data = us_change_future) %>% autoplot(us_change) + labs( x = "Year", y = "Percentage change", title = "Forecasts from regression with ARIMA(4,0,4) errors" )
 

In summary, ARIMAX is

notion image
 

Stochastic & deterministic trends


 
 

Dynamic harmonic regression


 
 

Lagged predictors


 
 
 
 
 
 
 
 
 
 
 
 
 

FAQ


How do you write up the RegArima equation?
 
 

Math


 
Exponential smoothing (ETS)Simple forecasting methods