I am examining monthly road accident counts over the last 25 years. I have created an ARIMA model in R using rainfall and temperature deviations from the long-term monthly average as exogenous variables, to see how these weather effects impact on the number of road collisions.

Now, I am looking to utilise the model to investigate what collisions would have looked like in those 25 years if the weather was normal, i.e. zero deviation in January from the long-term January average, zero deviation in February from the long-term February average, etc. Basically, how do I remove the impact of my weather variables from the collision time series?

My thinking is that I create an ARIMA forecast in which I replace the 'real' exogenous weather variables with 'normalised' weather variables (zero deviation from long-term averages, so essentially a time series of all zeros).

Is this approach sound / logical?


You have fit a regression with ARMA errors if you were using R function arima or forecast::Arima and including exogenous regressors (see Rob J. Hyndman's blog post "The ARIMAX model muddle" for details). You got something like

$$ \begin{aligned} y_t &= \beta' X_t + u_t \\ u_t &= \varphi_1 u_{t-1} + \dotsc + \varphi_p u_{t-p} + \varepsilon_t + \theta_1 \varepsilon_{t-1} + \dotsc + \theta_q \varepsilon_{t-q} \end{aligned} $$

with weather variables constituting $X_t$.

Assuming (1) the model is well specified and (2) there is a causal relationship between road accidents and weather variables, you may take the fitted values $\hat y_t$ and subtract the estimated coefficient vector $\hat\beta$ times the weather variables $X_t$. That should give you a counterfactual as if $X_t$ was zero all the time (weather always at long-term average).

However, it is important to keep in mind that (1) the model need not be well specified in reality and/or (2) the weather variables might not be causal to the road accidents. In that case the results you get would not be reliable.

  • $\begingroup$ @ Richard Hardy limitations understood. I used the Arima function, from the forecast package. If a transformation was applied to the series prior to modelling e.g. log, is it advisable to apply this method before taking the estimates out of the 'log world'? $\endgroup$ – ewenme Jul 25 '16 at 12:49
  • $\begingroup$ If you find that ARIMA fits $\log(y)$ better than $y$, it would be logical to do the adjustment for $\log(y)$ and then exponentiate the adjusted values. $\endgroup$ – Richard Hardy Jul 25 '16 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.