运用不规则时间序列

 In[1]:= Xpoi = PoissonProcess[1.2]; data = TimeSeries[RandomFunction[poi, {0, 100}]]
 Out[1]=
 In[2]:= XRegularlySampledQ[data]
 Out[2]=

 In[3]:= XListPlot[data, Filling -> Axis, ImageSize -> 300]
 Out[3]=

 In[4]:= Xmf[t_] = Mean[poi[t]]; cdata = TimeSeriesMapThread[Function[{t, x}, x - mf[t]], data];
 In[5]:= XListPlot[cdata, Filling -> Axis, ImageSize -> 300]
 Out[5]=

MovingMap 在置中的固定宽度滑动窗口计算均值.

 In[6]:= Xmts = MovingMap[Mean, cdata, {{{10}}, Center}, "Reflected"];
 Out[7]=

TimeSeriesAggregate 为固定宽度的非重叠性窗口中的最大数值构建固定间隔的时间序列.

 In[8]:= Xadata = TimeSeriesAggregate[data, {10, Right}, Max];
 Out[9]=
 Out[10]=

 In[11]:= Xrdata = TimeSeriesResample[data, 10, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 0}];
 Out[12]=
 In[13]:= XRegularlySampledQ[rdata]
 Out[13]=

 In[14]:= Xregdata = TimeSeries[data, TemporalRegularity -> True]
 Out[14]=
 In[15]:= Xdata["Path"] == regdata["Path"]
 Out[15]=
 In[16]:= XRegularlySampledQ[regdata]
 Out[16]=

Mathematica

Questions? Comments? Contact a Wolfram expert »