# 向量联合模型与单变量分量模型

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

TimeSeriesAggregate 计算每日最低和最高气温.

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

 In[4]:= XdataAll = TimeSeries[TimeSeriesThread[QuantityMagnitude, {min, max}], MetaInformation -> {"Units" -> {"DegreesCelsius", "DegreesCelsius"}, "Observation" -> {"Min Temperature", "Max Temperature"}}]
 Out[4]=
 Out[5]=

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

 In[7]:= XListPlot[TimeSeriesMap[Part[#, 1, 2] &, CorrelationFunction[data, {20}]], Filling -> Axis]
 Out[7]=

 In[8]:= Xmodel[p_, q_] := ARIMAProcess[p, q]; eproc = EstimatedProcess[data, model[1, 0]]
 Out[8]=

 In[9]:= Xn = 5; forecast = TimeSeriesForecast[eproc, data, {n}, Method -> "Covariance"];
 Out[10]=

 In[11]:= XminProc = EstimatedProcess[data["PathComponent", 1], model[3, 0]] minForecast = TimeSeriesForecast[minProc, data["PathComponent", 1], {n}, Method -> "Covariance"];
 Out[11]=
 In[12]:= XmaxProc = EstimatedProcess[data["PathComponent", 2], model[3, 0]] maxForecast = TimeSeriesForecast[maxProc, data["PathComponent", 2], {n}, Method -> "Covariance"];
 Out[12]=

 In[13]:= XuForecast = TimeSeries[ Transpose@{minForecast["Values"], maxForecast["Values"]}, {minForecast["Dates"]}]
 Out[13]=

 In[14]:= XplotData = TimeSeriesWindow[dataAll, {"May 20, 2014", Automatic}];
 Out[15]=

 Out[17]=

 Out[20]=

 Out[21]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »