# Forecasting Multi-variate data using Arima errors with Fourier terms and covariate on a weekly data in R

I'm planning to do a multivariate time series forecasting using arima errors with fourier terms. Data assumptions-moderate seasonality. one independent variable(x) and dependent variable(y) Weekly data collected for 148 weeks. y has some good correlation with x. So planning to forecast y based on the correlation with x along with the fourier values of y.

df.y<-ts(y, frequency=52)
df.x<-ts(x,frequency=52)
zx.f<-fourier(df.x, K=2,h=26) #fourier values of x variable
forecast.x<-auto.arima(df.x,xreg=zx.f,approximation=F,h=26) #forecast values of x

zy.f<-fourier(df.y,K=2,h=26) #fourier values of y variable
forecast.y<-auto.arima(df.y,xreg=cbind(forecast.x,zy.f),approximation=F,h=26) #forecast y using
fourier values of y and forecast values of x


Is it right to use forecasted values of x and Fourier values of Y when forecasting the Y variable? i have just used cbind on the xreg parameter to use both forecasted variable(x) and Fourier values of y

It is not only correct but also your only alternative in a situation where you do not have an external source that provides you with the forecasts associated with your variable df.x. However, you should consider that the error associated with performing forecasts of the external variable will also propagate to the forecast of the time series of interest, df.y. It may be useful to divide the problem into two stages: one that fits a suitable model for the x-series and forecasts its values to the necessary horizon, and then use those forecasts to specify the dynamic regression model you propose.
• I recommend that you separate the ARIMA model fitting with its forecast. You should pay attention in this case to forecast.y, because in xreg you should add df.x instead of its forecast, forecast.x, next to the fourier coefficients, while fitting. Once the model is fitted, you can use the forecast method to forecast and pass a new xreg with forecast.x and future fourier coefficients. I hope my explanation is understandable. Nov 23 '21 at 13:28