I have two variables $X$ and $Y$. For each variable I created a forecasting model (using time series) and estimated $X_{t+1}$ and $Y_{t+1}$ and the prediction interval and the error for each.

I have another variable $Z=f(X,Y)$, so $Z_{t+1}=f(X_{t+1},Y_{t+1})$.

How do I calculate the prediction interval and the error for $Z_{t+1}$?

  • $\begingroup$ Are you looking for a confidence interval or a prediction interval? In any case, the answer will depend heavily on $f$. If $f$ is the zero function, the CI/PI will be rather simple to give; if $f(x,y)=x^y$, not so much. Your best bet is likely to simulate from the forecasted distribution of $X$ and $Y$. $\endgroup$ Apr 13, 2016 at 14:20

1 Answer 1


Suppose that your predictive density for $X$ is uniform on $[0,1]$, while your predictive density for $Y$ is standard lognormal, and $f(x,y)=x^y$.

Then you can draw (a lot of) random numbers from each predictive density, plug them into $f$ and get a predictive distribution for $Z$, from which you can deduce expected errors (any error measure you want) and prediction intervals. In R:

nn <- 10000
xx <- runif(nn)
yy <- rlnorm(nn)


Note that for this to work, you will need to specify the full predictive densities - prediction intervals alone won't help you. That is inherent in the problem. Any prediction interval for (say) $X$ can be consistent with many predictive densities for $X$, and with many different resulting distributions for $Z$.


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.