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  (2)

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

FindFormula finds a formula that generates the data:

Plot the exponents of known Mersenne primes:

Find the best simple function describing the data:

Visualize the fitted functions with 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  (3)

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:

Orbital Mechanics  (1)

Plot the orbital periods of planets vs. their semimajor axes:

Find the best simple function describing the orbital radius in terms of the orbital period:

Find the constant of proportionality:

Compare with the exact formula given by Kepler's third law:

The exact constant of proportionality has value:

Compare with the different values from the orbital data directly:

Wolfram Research (2015), FindFormula, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFormula.html (updated 2017).

Text

Wolfram Research (2015), FindFormula, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFormula.html (updated 2017).

CMS

Wolfram Language. 2015. "FindFormula." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/FindFormula.html.

APA

Wolfram Language. (2015). FindFormula. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindFormula.html

BibTeX

@misc{reference.wolfram_2024_findformula, author="Wolfram Research", title="{FindFormula}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/FindFormula.html}", note=[Accessed: 17-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_findformula, organization={Wolfram Research}, title={FindFormula}, year={2017}, url={https://reference.wolfram.com/language/ref/FindFormula.html}, note=[Accessed: 17-November-2024 ]}