# Time Series Processes with Nonzero Mean

Mathematica 10 now supports time series processes with nonzero mean function, making it easier to forecast nonzero mean time series.

Sample a path from a nonzero mean ARMA(2,1) process.

 In[1]:= Xpath = TimeSeriesRescale[ RandomFunction[ ARMAProcess[2, {4/5, -3/5}, {2/3}, 1], {1, 365}], {"Jan 1 2013", "Dec. 31 2013"}]
 Out[1]=

Estimate ARMA(2,1) process from the data.

 In[2]:= X\[ScriptCapitalP]est = EstimatedProcess[path, ARMAProcess[2, 1]]
 Out[2]=

Compute the time average of the path and compare it to the mean of the process.

 In[3]:= X{Mean[path], Mean[\[ScriptCapitalP]est[t]]}
 Out[3]=

Forecast time series for the next 31 days.

 In[4]:= Xforecast = TimeSeriesForecast[\[ScriptCapitalP]est, path, {31}]
 Out[4]=

Visualize the generated path and the forecast.

 In[5]:= XDateListPlot[{path, forecast}, Filling -> Mean[path], PlotTheme -> "Detailed", Joined -> False, ImageSize -> Medium]
 Out[5]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »