Vector Joint Model versus Univariate Component Models

Get hourly temperature readings for May 2014 in Champaign, Illinois.

 In:= Xstart = {2014, 5, 1, 0, 0, 0}; end = {2014, 5, 31, 23, 59, 0};
 In:= Xtemp = WeatherData[{"Champaign", "IL"}, "Temperature", {start, end}]; temp1 = TimeSeries[temp, MissingDataMethod -> "Interpolation"]; temp2 = TimeSeriesResample[temp1, "Hour"];

Use TimeSeriesAggregate to calculate daily minimum and maximum temperatures.

 In:= Xmin = TimeSeriesAggregate[temp2, "Day", Min]; max = TimeSeriesAggregate[temp2, "Day", Max];

Combine them into a vector time series.

 In:= XdataAll = TimeSeries[TimeSeriesThread[QuantityMagnitude, {min, max}], MetaInformation -> {"Units" -> {"DegreesCelsius", "DegreesCelsius"}, "Observation" -> {"Min Temperature", "Max Temperature"}}]
 Out= Out= The first part of the data will be used to find a model, while the rest of the data will serve as a reference set for the forecast.

 In:= Xdata = TimeSeriesWindow[ dataAll, {Automatic, {2014, 5, 26, 23, 59, 0}}];

The temperatures are cross-correlated.

 In:= XListPlot[TimeSeriesMap[Part[#, 1, 2] &, CorrelationFunction[data, {20}]], Filling -> Axis]
 Out= Fit a vector model to the data.

 In:= Xmodel[p_, q_] := ARIMAProcess[p, q]; eproc = EstimatedProcess[data, model[1, 0]]
 Out= Forecast the next 5 days.

 In:= Xn = 5; forecast = TimeSeriesForecast[eproc, data, {n}, Method -> "Covariance"];
 Out= Find univariate models of the same type but longer orders for both temperatures separately.

 In:= XminProc = EstimatedProcess[data["PathComponent", 1], model[3, 0]] minForecast = TimeSeriesForecast[minProc, data["PathComponent", 1], {n}, Method -> "Covariance"];
 Out= In:= XmaxProc = EstimatedProcess[data["PathComponent", 2], model[3, 0]] maxForecast = TimeSeriesForecast[maxProc, data["PathComponent", 2], {n}, Method -> "Covariance"];
 Out= Combine univariate forecasts for plotting.

 In:= XuForecast = TimeSeries[ Transpose@{minForecast["Values"], maxForecast["Values"]}, {minForecast["Dates"]}]
 Out= Compare the forecasts.

 In:= XplotData = TimeSeriesWindow[dataAll, {"May 20, 2014", Automatic}];
 Out= Plot the vector forecast and the 95% confidence bands.

 Out= Plot the univariate forecasts and the 95% confidence bands.

 Out= Compare both forecasts and the corresponding confidence bands.

 Out= Questions? Comments? Contact a Wolfram expert »