‹

›

Find a Formula That Fits Temperature Variations

Load the temperatures in Rome for the last 10 years.

In[1]:= wd = WeatherData["Rome", "Temperature", {{2006, 1, 1}, {2016, 1, 1}, "Month"}]

Out[1]=

Find a simple formula for this time series.

In[2]:= fit = FindFormula[wd, x]

Out[2]=

Compare the formula and the data.

show complete Wolfram Language input

In[3]:= 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"}]]