Wolfram Language

Improved Machine Learning

Find a Formula That Fits Temperature Variations

Load the temperatures in Rome for the last 10 years.

In[1]:=
Click for copyable input
wd = WeatherData["Rome", "Temperature", {{2006, 1, 1}, {2016, 1, 1}, "Month"}]
Out[1]=

Find a simple formula for this time series.

In[2]:=
Click for copyable input
fit = FindFormula[wd, x]
Out[2]=

Compare the formula and the data.

show complete Wolfram Language input
In[3]:=
Click for copyable input
Show[Plot[fit, {x, 3.5*10^9 , 3.71*10^9}, PlotStyle -> Lighter[Red, .5], PlotLegends -> {"Formula"}, Frame -> True, FrameLabel -> {"Absolute Time", "Temperature"}], ListPlot[wd, PlotLegends -> {"Data"}]]
Out[3]=

Related Examples

de es fr ja ko pt-br ru zh