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

Examples

open allclose all

Basic Examples  (1)

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

FindFormula finds a formula that generates the data:

Scope  (3)

Generate data with normally distributed noise:

Visualize the data:

Find the first 5 best functions that approximate data:

Visualize the fitted functions with the data:

Generate data with normally distributed noise:

Visualize the data:

Visualize the dataset for the first 5 functions that approximate data:

Generate data with normally distributed noise:

Visualize the data:

Look at the first 300 fits and plot their score as functions of the errors and complexity for different settings of SpecificityGoal:

Visualize the first fitted function with the data:

Options  (4)

PerformanceGoal  (1)

Generate data with normally distributed noise:

Visualize the data:

Find the best function that approximates data with its internal score:

Find the best function that approximates data using PerformanceGoal with its internal score:

Visualize the fitted functions with the data:

RandomSeeding  (1)

Generate data with normally distributed noise:

Compare different evaluations of FindFormula and notice how they differ:

Use the option RandomSeeding to avoid having different results:

SpecificityGoal  (1)

Generate data with normally distributed noise:

Visualize the data:

Find the best functions that approximate data with their errors using different values of SpecificityGoal:

Visualize the fitted functions with the data:

TargetFunctions  (1)

Generate data with normally distributed noise:

Visualize the data:

Find the best function that approximates data:

Find the best function that approximates data using TargetFunctions:

Visualize the fitted functions with the data:

Applications  (2)

Population Growth  (1)

Population growth in Poland:

Find the best function that describes data:

Visualize the fitted function with the data:

Find a fit for the first 100 prime numbers:

Compare the fit with the data and with the next 200 primes:

Differential Equation  (1)

Find a fit for the numerical solution of a differential equation:

Compare the fit with the data:

Introduced in 2015
 (10.2)
 |
Updated in 2017
 (11.2)