Well the title actually says it all. Is there a function that finds the best fit for data points without any user-inputed information about the form the formula might have?
Here is the data I want to find a fit for: data={8, 11.2, 10.3, 8.1, 13.6, 2.8, 3.2, 1.3, 1.8, 1, 0.3, 0.2, 0, 2.1}
It is the annual sales of DVD-A from 2001 to 2014 (this is the whole dataset). In 2003, a direct competitor to the DVD-A appeared, the SA-CD. So I would like to graphically illustrate the fact that the trend in the sales of the DVD-A change drastically from the moment the SA-CD made it's appearance. Obviously, there are only two observations before 2003, so a linear fit is obvious... But I'm having trouble finding a continuous function that illustrates the sales trend from 2003 to 2014.
So the predictor variable is simply {3,4,...,14}
.
Here is a graph of the data, the linear trend for the years 2001 and 2002 and the chopped-up function for the 2003-2014 period provided by the FindFormula
described below:
Code for the graph:
Show[ListLinePlot[data,(*DVD-A*)
PlotStyle ->Directive[CMYKColor[0.37,0.,0.44,0.48]
,Thickness[.008],Opacity[.5]]
,Frame -> True
,PlotRange -> All
,FrameTicks-> {Automatic, {Table[{i, 2000 + i}, {i, 0, 14}], None}}
,PlotLabel -> "Sales evolution of DVD-A"
,FrameLabel -> {None, "Sales\n(Millions, 2013 USD)"}]
,Plot[Evaluate@LinearModelFit[data[[{1,2}]], t, t][t], {t, 0.75, 2.5}]
,Plot[Evaluate@FindFormula[data[[3;;]], t, 5,SpecificityGoal -> 3][[4]], {t,4, 14}] ]
Until now, I have tried this: FindFormula[data[[3;;]], t, 5, SpecificityGoal -> 3]
, which gives a chopped-up fonction with different chunks. I would like to find a continuous function that fits the data (I already tried with NonlinearFit
with different orders polynomials and did not get a visually good estimation of the data from 2003 to 2014).
Thanks,
FindFormula
if you have version 10.2 or above. But you still need to examine the fit afterwords. $\endgroup$