Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

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 , , etc.

Details and OptionsDetails and Options

  • The data should be either an array of the form or , or a TimeSeries object.
  • Data of the form is equivalent to data of the form .
  • 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
    Allall the previous properties
  • The following options can be given:
  • PerformanceGoalAutomaticaspect of performance to optimize
    "RandomSeed"Automaticstarting value for the random number generator
    SpecificityGoal1
  • what formula complexity to seek
  • TargetFunctionsAllfunctions to consider
    TimeConstraintAutomaticmaximum 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
    sspecificity 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:
  • Allall functions listed below
    {f_(1),f_(2),}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:
  • Automaticautomatic
    tmaximum t seconds

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Find a fit to some data:

In[51]:=
Click for copyable input
Out[52]=

Visualize the fitted function with the data:

In[53]:=
Click for copyable input
Out[53]=
Introduced in 2015
(10.2)