Trabalhando com séries temporais cujos valores são medidas estatísticas
Analise a variabilidade de temperatura em um determinado local.
In[1]:=
![Click for copyable input](assets.pt-br/working-with-quantity-valued-time-series/In_94.png)
data = WeatherData[
Entity["City", {"Champaign", "Illinois", "UnitedStates"}],
"Temperature", {{2016, 3, 20}, {2016, 3, 22}}];
In[2]:=
![Click for copyable input](assets.pt-br/working-with-quantity-valued-time-series/In_95.png)
temps = TimeSeries[data, MissingDataMethod -> "Interpolation"]
Out[2]=
![](assets.pt-br/working-with-quantity-valued-time-series/O_61.png)
Visualize a séries temporais de temperatura.
In[3]:=
![Click for copyable input](assets.pt-br/working-with-quantity-valued-time-series/In_96.png)
DateListPlot[temps, PlotTheme -> "Detailed"]
Out[3]=
![](assets.pt-br/working-with-quantity-valued-time-series/O_62.png)
Propriedades básicas.
In[4]:=
![Click for copyable input](assets.pt-br/working-with-quantity-valued-time-series/In_97.png)
stats = {Min, Max, Mean, Median, StandardDeviation};
TableForm[{Map[#[temps] &, stats]}, TableHeadings -> {None, stats}]
Out[4]//TableForm=
![](assets.pt-br/working-with-quantity-valued-time-series/O_63.png)
Converta as temperaturas em graus Fahrenheit.
In[5]:=
![Click for copyable input](assets.pt-br/working-with-quantity-valued-time-series/In_98.png)
tempsF = UnitConvert[temps, "DegreesFahrenheit"];
TableForm[{Map[#[tempsF] &, stats]}, TableHeadings -> {None, stats}]
Out[5]//TableForm=
![](assets.pt-br/working-with-quantity-valued-time-series/O_64.png)
Ache a média móvel de 6 horas.
In[6]:=
![Click for copyable input](assets.pt-br/working-with-quantity-valued-time-series/In_99.png)
avg = MovingMap[Mean, temps, {Quantity[6, "Hours"], Center}]
Out[6]=
![](assets.pt-br/working-with-quantity-valued-time-series/O_65.png)
mostre o input completo da Wolfram Language
Out[7]=
![](assets.pt-br/working-with-quantity-valued-time-series/O_66.png)