System

FindFormula

FindFormula[data]

finds a pure function that approximates data.

FindFormula[data,x]

finds a symbolic function of the variable x that approximates data.

FindFormula[data,x,n]

finds up to n functions that approximate data.

FindFormula[data,x,n,prop]

returns up to n best functions associated with property prop.

FindFormula[data,x,n,{prop1,prop2,}]

returns up to n best functions associated with properties prop1, prop2, etc.

Details and Options

• The data should be either an array of the form {{x1, y1},{x2, y2},} or {y1,y2,}, or a TimeSeries object.
• Data of the form {y1,y2,} is equivalent to data of the form {{1,y1},{2,y2},}.
• FindFormula[data,x,n,All] creates a Dataset object with all possible properties.
• Properties supported include:
•  "Score" internal score "Complexity" complexity of the function "Error" mean squared error All all the previous properties
• The following options can be given:
•  PerformanceGoal Automatic aspect of performance to optimize SpecificityGoal 1 what formula complexity to seek TargetFunctions All functions to consider TimeConstraint Automatic maximum time to be spent in finding the result
• Possible settings for PerformanceGoal include:
•  "Speed" minimize the time spent in finding the result "Quality" try to find better results
• Possible settings for SpecificityGoal include:
•  "Low" for simpler fits "High" for more complex functions s specificity between 0 (lowest) and Infinity (highest)
• FindFormula[data,x,SpecificityGoal->Infinity] finds solutions that minimize the error.
• SpecificityGoal equal to 1 gives the best predictive performance.
• Possible settings for TargetFunctions include:
•  All all functions listed below {,,…} functions
• Possible functions for TargetFunctions are Plus, Times, Power, Sin, Cos, Tan, Cot, Log, Sqrt, Csc, Sec, Abs, and Exp.
• Possible settings for TimeConstraint include:
•  Automatic automatic t maximum t seconds

Examples

open allclose all

Basic Examples(1)

Make a table of values of the function x Sin[x]:

 In[1]:=
 Out[1]=

FindFormula finds a formula that generates the data:

 In[2]:=
 Out[2]=