TimeSeriesForecast
✖
TimeSeriesForecast
gives the k-step-ahead forecast beyond data according to the time series process tproc.
Details and Options

- TimeSeriesForecast[tproc,{x0,…,xm},k] will give Expectation[x[m+k]x[0]x0∧…∧x[m]xm], where xtproc, the expected value of the process given data.
- TimeSeriesForecast allows tproc to be a time series process such as ARProcess, ARMAProcess, SARIMAProcess, etc.
- The data can be a list of numeric values {x1,x2,…}, a list of time-value pairs {{t1,x1},{t2,x2},…}, or TemporalData.
- The following forecast specifications can be given:
-
k at the k step ahead
{kmax} at 1, …, kmax steps ahead {kmin,kmax} at kmin, …, kmax steps ahead {{k1,k2,…}} use explicit {k1,k2,…} steps ahead - TimeSeriesForecast returns the forecasted value if k is an integer and TemporalData otherwise.
- The default for k is 1.
- TimeSeriesForecast supports a Method option with the following settings:
-
Automatic automatically determine the method "AR" approximate with a large-order AR process "Covariance" exact covariance function-based "Kalman" use Kalman filter - The mean squared errors of the prediction are the compounded noise errors and are given as MetaInformation in the TemporalData output. For forecast=TimeSeriesForecast[tproc,data,k], the mean squared errors can be accessed by forecast["MeanSquaredErrors"].
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Forecast three steps ahead for an ARProcess:

https://wolfram.com/xid/0jz9y9fp6f2gie-oyzkai

https://wolfram.com/xid/0jz9y9fp6f2gie-fc5vyq

An ARMAProcess:

https://wolfram.com/xid/0jz9y9fp6f2gie-dodo4

Predict the seventh value from TimeSeriesModel:

https://wolfram.com/xid/0jz9y9fp6f2gie-kpk3yi

https://wolfram.com/xid/0jz9y9fp6f2gie-fckpgv

Mean squared error of the forecast:

https://wolfram.com/xid/0jz9y9fp6f2gie-cnhyyb

Forecast a vector-valued time series process:

https://wolfram.com/xid/0jz9y9fp6f2gie-z2srib
Find the forecast for the next 10 steps:

https://wolfram.com/xid/0jz9y9fp6f2gie-uxaf8m

Plot the data and the forecast for each component:

https://wolfram.com/xid/0jz9y9fp6f2gie-f5ibl8

Scope (7)Survey of the scope of standard use cases
Step (4)

https://wolfram.com/xid/0jz9y9fp6f2gie-sf1dzs

https://wolfram.com/xid/0jz9y9fp6f2gie-1r6zyl

Forecast the third step ahead:

https://wolfram.com/xid/0jz9y9fp6f2gie-fjbrvl

Find forecast for all the steps ahead up to the fifth:

https://wolfram.com/xid/0jz9y9fp6f2gie-pyg5ri

https://wolfram.com/xid/0jz9y9fp6f2gie-qh00x6


https://wolfram.com/xid/0jz9y9fp6f2gie-y1m35l

Forecast all the steps ahead in the range from third to fifth:

https://wolfram.com/xid/0jz9y9fp6f2gie-jbz2ft

https://wolfram.com/xid/0jz9y9fp6f2gie-wubp48


https://wolfram.com/xid/0jz9y9fp6f2gie-1s4z8k


https://wolfram.com/xid/0jz9y9fp6f2gie-wvlg5a

https://wolfram.com/xid/0jz9y9fp6f2gie-hr5d7t


https://wolfram.com/xid/0jz9y9fp6f2gie-gxwpmw

Mean Squared Errors (3)

https://wolfram.com/xid/0jz9y9fp6f2gie-qdv7mz

https://wolfram.com/xid/0jz9y9fp6f2gie-ezbgro

Return the forecast as TemporalData to extract mean squared errors:

https://wolfram.com/xid/0jz9y9fp6f2gie-pm7akx


https://wolfram.com/xid/0jz9y9fp6f2gie-vy2sta


https://wolfram.com/xid/0jz9y9fp6f2gie-bd3ye0

Find the forecast with mean squared errors:

https://wolfram.com/xid/0jz9y9fp6f2gie-ecot7l

https://wolfram.com/xid/0jz9y9fp6f2gie-s0dtlb

https://wolfram.com/xid/0jz9y9fp6f2gie-h3pqyi

https://wolfram.com/xid/0jz9y9fp6f2gie-cu49hu

https://wolfram.com/xid/0jz9y9fp6f2gie-0hg2yf
Plot the data and forecast with mean error bands:

https://wolfram.com/xid/0jz9y9fp6f2gie-i2hoip

Find the forecast with 95% confidence intervals:

https://wolfram.com/xid/0jz9y9fp6f2gie-ki9f6k
Find the forecast for the next 10 steps:

https://wolfram.com/xid/0jz9y9fp6f2gie-x57kie
Find mean squared errors and confidence intervals:

https://wolfram.com/xid/0jz9y9fp6f2gie-pdviaz

https://wolfram.com/xid/0jz9y9fp6f2gie-f5fojr

https://wolfram.com/xid/0jz9y9fp6f2gie-wkr3wc
Plot data, forecast, and the forecast limits:

https://wolfram.com/xid/0jz9y9fp6f2gie-4adu48

Options (4)Common values & functionality for each option
Method (4)
Find the forecast using the covariance-based method:

https://wolfram.com/xid/0jz9y9fp6f2gie-zc5umt


https://wolfram.com/xid/0jz9y9fp6f2gie-mdf3gq

Find the forecast using the autoregressive method:

https://wolfram.com/xid/0jz9y9fp6f2gie-fyqj6x


https://wolfram.com/xid/0jz9y9fp6f2gie-z5oan8

Find the forecast using the Kalman filter method:

https://wolfram.com/xid/0jz9y9fp6f2gie-t8k8zl


https://wolfram.com/xid/0jz9y9fp6f2gie-06t7na

Compare exact and approximate methods for an MAProcess:

https://wolfram.com/xid/0jz9y9fp6f2gie-52s586

https://wolfram.com/xid/0jz9y9fp6f2gie-2d20n7


https://wolfram.com/xid/0jz9y9fp6f2gie-oat5jb

Both methods agree for the autoregressive processes:

https://wolfram.com/xid/0jz9y9fp6f2gie-5kgd4d

https://wolfram.com/xid/0jz9y9fp6f2gie-w8vvbn


https://wolfram.com/xid/0jz9y9fp6f2gie-rgulqm

Applications (3)Sample problems that can be solved with this function
The daily exchange rates of the euro to the dollar from May 2012 through September 2012:

https://wolfram.com/xid/0jz9y9fp6f2gie-iqliwg

https://wolfram.com/xid/0jz9y9fp6f2gie-ksytjw


https://wolfram.com/xid/0jz9y9fp6f2gie-jm5uvi

Fit an AR process to the exchange rates:

https://wolfram.com/xid/0jz9y9fp6f2gie-1lkzx3

Forecast for 20 business days ahead:

https://wolfram.com/xid/0jz9y9fp6f2gie-3da2v4

Plot the forecast with original data:

https://wolfram.com/xid/0jz9y9fp6f2gie-x82zye

Consider hourly temperature readings for September 9, 2012, near your location:

https://wolfram.com/xid/0jz9y9fp6f2gie-2wl7zr

The data contains missing values:

https://wolfram.com/xid/0jz9y9fp6f2gie-3nxtyb

Redefine time series with MissingDataMethod to fill in missing data with interpolated values:

https://wolfram.com/xid/0jz9y9fp6f2gie-plysjd

Check if the time stamps are regularly spaced:

https://wolfram.com/xid/0jz9y9fp6f2gie-i472ls


https://wolfram.com/xid/0jz9y9fp6f2gie-umr0td


https://wolfram.com/xid/0jz9y9fp6f2gie-3nubr8

Estimate an ARProcess:

https://wolfram.com/xid/0jz9y9fp6f2gie-xyaiaj

Calculate prediction for the next 12 hours:

https://wolfram.com/xid/0jz9y9fp6f2gie-p8j6el

Plot forecast with original data:

https://wolfram.com/xid/0jz9y9fp6f2gie-vga9xk

Retail monthly sales in United States:

https://wolfram.com/xid/0jz9y9fp6f2gie-qjusom

https://wolfram.com/xid/0jz9y9fp6f2gie-uczmaw

Create TimeSeries from the selection:

https://wolfram.com/xid/0jz9y9fp6f2gie-oen04n

Plot the sales with grid lines at December peaks:

https://wolfram.com/xid/0jz9y9fp6f2gie-n5gcnj


https://wolfram.com/xid/0jz9y9fp6f2gie-lfflei


https://wolfram.com/xid/0jz9y9fp6f2gie-y101ce

Find forecast for the next 7 years:

https://wolfram.com/xid/0jz9y9fp6f2gie-9o4zwf

Calculate 95% confidence bands for the forecast:

https://wolfram.com/xid/0jz9y9fp6f2gie-q4uytd

There is an upper and a lower band:

https://wolfram.com/xid/0jz9y9fp6f2gie-jy9kj7

Plot the forecast within the 95% confidence region:

https://wolfram.com/xid/0jz9y9fp6f2gie-66trwe

https://wolfram.com/xid/0jz9y9fp6f2gie-mrioe4

Properties & Relations (3)Properties of the function, and connections to other functions
Forecasting with ARProcess using the exact or approximate method gives the same result:

https://wolfram.com/xid/0jz9y9fp6f2gie-hiusje


https://wolfram.com/xid/0jz9y9fp6f2gie-lwbd3n


https://wolfram.com/xid/0jz9y9fp6f2gie-66q78i

Forecast is the same for a time series process and its invertible representation:

https://wolfram.com/xid/0jz9y9fp6f2gie-y93h5i
This process is not invertible:

https://wolfram.com/xid/0jz9y9fp6f2gie-e5am82

Find its invertible representation:

https://wolfram.com/xid/0jz9y9fp6f2gie-ik4d2e


https://wolfram.com/xid/0jz9y9fp6f2gie-w1v9ni

https://wolfram.com/xid/0jz9y9fp6f2gie-1dl7yq


https://wolfram.com/xid/0jz9y9fp6f2gie-5vjd1v


https://wolfram.com/xid/0jz9y9fp6f2gie-zxt6qz


https://wolfram.com/xid/0jz9y9fp6f2gie-ox1f7m

Use TimeSeriesModel to forecast:

https://wolfram.com/xid/0jz9y9fp6f2gie-7pdlz2

https://wolfram.com/xid/0jz9y9fp6f2gie-jgcsub

Compute forecast for 20 steps:

https://wolfram.com/xid/0jz9y9fp6f2gie-elat0r

Use process and data explicitly:

https://wolfram.com/xid/0jz9y9fp6f2gie-f56h3h


https://wolfram.com/xid/0jz9y9fp6f2gie-6xjb4r

Possible Issues (2)Common pitfalls and unexpected behavior
"Kalman" method requires the parameters of the process to be numeric:

https://wolfram.com/xid/0jz9y9fp6f2gie-ysiqus


If the invertible representation does not exist, the forecast may not be reliable:

https://wolfram.com/xid/0jz9y9fp6f2gie-18s83k




https://wolfram.com/xid/0jz9y9fp6f2gie-qozxo

Wolfram Research (2012), TimeSeriesForecast, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeSeriesForecast.html (updated 2014).
Text
Wolfram Research (2012), TimeSeriesForecast, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeSeriesForecast.html (updated 2014).
Wolfram Research (2012), TimeSeriesForecast, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeSeriesForecast.html (updated 2014).
CMS
Wolfram Language. 2012. "TimeSeriesForecast." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/TimeSeriesForecast.html.
Wolfram Language. 2012. "TimeSeriesForecast." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/TimeSeriesForecast.html.
APA
Wolfram Language. (2012). TimeSeriesForecast. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeSeriesForecast.html
Wolfram Language. (2012). TimeSeriesForecast. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeSeriesForecast.html
BibTeX
@misc{reference.wolfram_2025_timeseriesforecast, author="Wolfram Research", title="{TimeSeriesForecast}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/TimeSeriesForecast.html}", note=[Accessed: 11-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_timeseriesforecast, organization={Wolfram Research}, title={TimeSeriesForecast}, year={2014}, url={https://reference.wolfram.com/language/ref/TimeSeriesForecast.html}, note=[Accessed: 11-May-2025
]}