I have a time series of a variable V1 with seasonality and a strong trend. The trend however seems to be closely related to (and caused by) the trend of another time varying variable (V2). As V2 grows i.e shows a positive trend, the trend on V1 declines (see chart). enter image description here

I want to use V2 as an exogenous variable in the time series forecast of V1. I am using prophet for this where I forecast V2 and then use it as an exogenous variable to forecast V1. But, since V2 has a trend that affects the trend of V1 does it make sense to use V2 as an exogenous variable at all? I can simply run a forecast with and without the exogenous variable to see what difference it makes. It might not be much, but I am more interested in knowing if there is a fundamental flaw in using exogenous variables with trends.

The question is similar to this one, but it was not very clear to me.


1 Answer 1


Lets say you want to predict $y_t$ based on its past $y_{0},y_{1},...,y_{t-1}$, as well as based on exogenous variable $x_t$. Models such as the additive Prophet model treat $x_t$ as independent over time. Hence, Prophet will not notice a trend in the process $\{x_0,x_1,...,x_t\}$ because it only looks at $x_t$ and then immediately forgets $x_t$ (see here)

However, this does not mean that you cannot use $x_t$ to predict $y_t$. If $x_t$ is a good external regressor for $y_t$, then there must exist some function $f$ such that $f(x_t)\approx y_t$. This does not change if there is a trend in $\{x_0,x_1,...,x_t\}$. For example, if your exogenous variable is actually a straight line with slope $k_1$ and y-intercept $d_1$, and your target variable is a straight line with slope $k_2$ and y-intercept $d_2$, then the solution is $f(x_t)=\frac{k_2}{k_1}(x_t-d_1)+d_2=y_t$. Since Prophet treats all external variables as linear regressors, it can solve this particular problem.

For the data you posted, I do not think that there is a linear function from the exogenous variable to the target variable. So Prophet should not be able to learn this exactly - in fact, it cannot be more exact than the best linear function from $x_0,...,x_t$ to $y_0,...,y_t$.


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.