3
$\begingroup$

I have two time series: 1) Which only contains historical data for production 2006-2011 on a monthly basis. 2) Which contains both historical and projected flow data 2006-2057 on a monthly basis.

I would like to use VAR to use the flow data as a predictor for the production. My problem is that the data is seasonal and I don't know how to handle VAR with seasonality? If I use SARMA I will not be able (to my understanding) to use the flow measurement as a predictor for the production.

$\endgroup$
4
$\begingroup$

VAR models are routinely used with seasonal data, e.g. in macroeconomics where most of the time series (such as GDP or unemployment) are seasonal. Seasonality is handled either (1) outside of the model (by seasonally adjusting the series before fitting a VAR model) or (2) within the model (by including seasonal dummy variables, for example).

For (1), seasonal decomposition can be performed by function stl, decompose (as mentioned in another answer by @GD_N) or by fitting a univariate SARIMA model or an ARIMA model with seasonal dummies or Fourier terms - but there are other options, too.

For (2), seasonal dummies can be included as exogenous regressors or via the optional argument season in the vars::VAR function in R (scroll down in the package manual for details).

$\endgroup$
  • $\begingroup$ Could you please enlarge on (1) vs (2)? Two stage estimation like (1) always felt like a hack to me, but makes sense if seasonality isn't the main interest (just a known source of signal you want to get rid of) and is too complex to be handled directly by your model. Incidentally, I asked about this a while ago and yours is a perfect and natural example stats.stackexchange.com/questions/246390/… $\endgroup$ – mugen Dec 31 '16 at 18:45
  • 1
    $\begingroup$ @mugen, I see that I was the only one who upvoted that question and marked as a favourite :) I don't know a general answer. I think that seasonal terms are orthogonal to any regressors in population by definition (think what seasonal terms do), while in finite samples this is approximately so. When a subset of regressors is orthogonal to the remaining subset, the effect of the former can be removed by regressing the dependent variable on just them and subtracting the fitted values without loss of efficiency. That is a nice feature of orthogonal regressors for a regression with i.i.d. errors. $\endgroup$ – Richard Hardy Jan 1 '17 at 9:19
  • 1
    $\begingroup$ @mugen, However, this breaks down when errors are not i.i.d., as is often the case in time series. Then it is hard to tell what the effect is. But AFAIK, (1) against (2) is not clear cut in practice. E.g. in macroeconomics it is very common to do (1), but in some simpler systems (2) could work better. I don't know really. $\endgroup$ – Richard Hardy Jan 1 '17 at 9:20
0
$\begingroup$

Let me explain you in steps on removing seasonality:

  1. Detect the trend: first find if the time series is additive or multiplicative
  2. Detrend the time series: this will expose seasonality.
  3. Average seasonality: from the detrend time series, it’s easy to compute the average seasonality. We add the seasonality together and divide by the number of seasonality.

If you are using R, there are two functions, decompose and stl, which help you do the above said. Often, the decomposition is used to removes the seasonal effect from a time series. It provided a cleaner way to understand the trend.

  • Note 1: you can use the autocorrelation function to identify the seasonality (weekly, monthly, quarterly, half-yearly or yearly)
  • Note 2: SARMA handles seasonality, read on it too.
$\endgroup$
  • 1
    $\begingroup$ Thank you @GD_N for your answer. As I have a predictor I would like to use it and therefore I think using VAR is the way to go. As for SARMA it only considers on parameter, which is not what I would optimally want to do. For the de-seasoning my data I was considering using 12 dummies (one for each month) to remove the seasonality but still using VAR with one predictor. Would that be a feasible approach or is decomposing the data set the only way to go with seasonality? $\endgroup$ – N_Moksnes Dec 28 '16 at 9:58
  • $\begingroup$ can you share me your data and your objective ? that will help me! $\endgroup$ – GD_N Dec 28 '16 at 10:22
  • $\begingroup$ the objective is to forecast the production by using both the historical production and the predictor eg. (with two lags, two seasons represented as dummies) prod=c1*prod(-1)+c2*prod(-2)+c3*flow(-1)+c4*flow(-2)+c5*Dummy1+c6*Dummy2 . My question is if that is a good approach as I have seasonality or if I should take some other measures (like your proposal of decompose)? $\endgroup$ – N_Moksnes Dec 28 '16 at 11:51

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.