# R arimax forecast with fourier

I am forecasting two weekly sales series (Series A & B) with apparently trend and seasonality. I only have two years of data so it's barely enough for estimating the seasonal components. These two series are closely linked to each other, though with some different reactions to holidays. My goal is to study if Series B reaches its annual goal, what will be the impact on A. Any hints on what to do? I couldn't find a good introduction example in R for the VAR approach and not sure how to do forecasting of one series conditional on another.

What I did is following this instruction for my weekly data: https://robjhyndman.com/hyndsight/forecasting-weekly-data, using Fourier terms for the seasonality and Series B as the XREG for series A. The residuals of the fit seems to be somehow stabilized (with some spike at lag 12 which I am not sure how to handle)

It seems B explains most of the seasonal & trend component in A ( as for the reaction for holidays). The model I got is often ARIMA (0, 0, 0) for some training/validation split. Does this sound like an okay approach? I used rolling window cross validation and forecasting MAPE is around 10%.

I know the auto.arima function in the forecast package can help with the de-trend automatically. Will that takes care of the XREG including the Fourier components as well?

Yes, auto.arima() will account for explanatory variables. It fits a regression on the explanatory variables with ARIMA errors. (Note that this is not an ARIMAX model.)
You may be able to leverage how your series are "linked". Look at Rob Hyndman's work on hierarchical time series and the hts package for R. You may be able to get better forecasts by treating your two series as a small hierarchy.