Wolfram言語

確率と統計における数量

数量値の時系列を使う

指定の場所における気温の変化を解析する.

In[1]:=
Click for copyable input
data = WeatherData[ Entity["City", {"Champaign", "Illinois", "UnitedStates"}], "Temperature", {{2016, 3, 20}, {2016, 3, 22}}];
In[2]:=
Click for copyable input
temps = TimeSeries[data, MissingDataMethod -> "Interpolation"]
Out[2]=

気温の時系列を可視化する.

In[3]:=
Click for copyable input
DateListPlot[temps, PlotTheme -> "Detailed"]
Out[3]=

基本の特性.

In[4]:=
Click for copyable input
stats = {Min, Max, Mean, Median, StandardDeviation}; TableForm[{Map[#[temps] &, stats]}, TableHeadings -> {None, stats}]
Out[4]//TableForm=

気温を華氏に変換する.

In[5]:=
Click for copyable input
tempsF = UnitConvert[temps, "DegreesFahrenheit"]; TableForm[{Map[#[tempsF] &, stats]}, TableHeadings -> {None, stats}]
Out[5]//TableForm=

6時間の移動平均を求める.

In[6]:=
Click for copyable input
avg = MovingMap[Mean, temps, {Quantity[6, "Hours"], Center}]
Out[6]=
完全なWolfram言語入力を表示する
In[7]:=
Click for copyable input
DateListPlot[{temps, avg}, PlotLegends -> {"temperatures", "6-hour moving average"}, FrameLabel -> Automatic, PlotTheme -> "Detailed"]
Out[7]=

関連する例

de en es fr ko pt-br ru zh