2
$\begingroup$

I have six time series, all made of daily historical data. All of them cover the same period and the same days, they are all about 2700 days long. I want to explain one of the time series as a function of the other five, every day; i.e. for each day "i" I'd like to obtain a functional relationship of this sort:

ts1_i = f(ts2_i, ts3_i, ts4_i, ts5_i, ts6_i)

I am not sure what method or approach is more adequate for doing so, and if I should use machine learning techniques (I am new on it). As a starting point, I have performed PCA analysis on the entire data set of six time series, and rank correlation tests for each pairs. (PS: I use R, it would be great to have suggestions about R functions and packages)

$\endgroup$
4
  • $\begingroup$ What is your goal? Inference, prediction, or forecast? R package nlme offers regression models that include a model for residual autocorrelation. $\endgroup$
    – Roland
    Jun 27, 2016 at 14:40
  • $\begingroup$ @Roland my aim is to understand how each time series influences ts1, and use those that have most of the influence on ts1 for predictions. I'd say my goal is dimensionality reduction and prediction $\endgroup$
    – stem
    Jun 27, 2016 at 14:51
  • $\begingroup$ @stem Do you just want contemporaneous relationship, or intertemporal dependence, ie. $x^1_t = f( x^2_t, x^2_{t-1}, ...., x^3_t, x^3_{t-1},...., x^6_t, x^6_{t-1}....)$ $\endgroup$
    – horaceT
    Jun 28, 2016 at 18:48
  • $\begingroup$ @horaceT no intertemporal dependence is required, only contemporaneous relations $\endgroup$
    – stem
    Jun 29, 2016 at 20:46

3 Answers 3

4
$\begingroup$

Box-Jenkins laid out an approach to do this in their text book published in 1970 called "Transfer Function modeling". In short, you build a model for each causal and then use the residuals to find correlation with the Y variable. Don't forget to look for outliers too as they exist.

$\endgroup$
2
  • $\begingroup$ Thanks @Tom-Reilly, I have never used this technique and I am going to search for more information about it. I was also looking for predictability of the ts1 using the other time series, or better for how much of the ts1 the other time series can account for. Does the Transfer Function modeling help with that? $\endgroup$
    – stem
    Jun 27, 2016 at 14:37
  • $\begingroup$ Yes, it will help. $\endgroup$
    – Tom Reilly
    Jun 27, 2016 at 15:31
4
$\begingroup$

Before you toss your time series into arimax, make sure you check if they are stationary. This is a crucial assumption for time series regression. If some of the time series on the RHS are $I(1)$, you'd get meaningless result, the so-called spurious regression in the econometrics literature.

You can see it with a few lines of 'R' codes. Try use the S&P 500 for $y_t$ and Nasdaq for $x_t$.

$y_t = \alpha + \beta x_t + \epsilon$

As you toss in more and more data, the regression R squared gets better and better. In fact, as $N \rightarrow \infty$, the p-value of your coefficient approaches zero and your $R^2$ approaches 1.

This is a famous paper :

Phillips, P. C. (1986). Understanding spurious regressions in econometrics. Journal of econometrics, 33(3), 311-340.

$\endgroup$
4
$\begingroup$

The simplest model I can think of for this problem is ARMAX, which is a bit like an ARMA model with exogenous parameters stuck on the end. However, there doesn't actually seem to be a direct implementation of these models in R.

Rob Hyndman (who occasionally posts here) has a nice blog post describing these models. As Rob points out, ARMAX is a special case of the transfer function model mentioned by Tom Reilly. In fact, the TSA package has a function called arimax, which actually fits transfer functions under the guise of ARIMAX.

$\endgroup$
3
  • $\begingroup$ thanks I'll check the function and the blog. As I wrote above, my aim is to understand how each time series influences ts1, and use those that have most of the influence on ts1 for predictions. I have a dual goal, that is dimensionality reduction and prediction $\endgroup$
    – stem
    Jun 27, 2016 at 15:22
  • $\begingroup$ @RichardHardy perhaps not. I will update $\endgroup$ Jun 28, 2016 at 18:19
  • $\begingroup$ @RichardHardy nope you're just keeping me honest! $\endgroup$ Jun 28, 2016 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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