WOLFRAM

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)Summary of the most common use cases

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

Out[1]=1

FindFormula finds a formula that generates the data:

Out[2]=2

Plot the exponents of known Mersenne primes:

Out[1]=1

Find the best simple function describing the data:

Out[2]=2

Visualize the fitted functions with the data:

Out[3]=3

Scope  (3)Survey of the scope of standard use cases

Generate data with normally distributed noise:

Visualize the data:

Out[2]=2

Find the first 5 best functions that approximate data:

Out[3]=3

Visualize the fitted functions with the data:

Out[4]=4

Generate data with normally distributed noise:

Visualize the data:

Out[2]=2

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

Out[3]=3

Generate data with normally distributed noise:

Visualize the data:

Out[2]=2

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

Out[4]=4
Out[6]=6

Visualize the first fitted function with the data:

Out[7]=7

Options  (4)Common values & functionality for each option

PerformanceGoal  (1)

Generate data with normally distributed noise:

Visualize the data:

Out[2]=2

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

Out[4]=4

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

Out[5]=5

Visualize the fitted functions with the data:

Out[6]=6

RandomSeeding  (1)

Generate data with normally distributed noise:

Compare different evaluations of FindFormula and notice how they differ:

Out[2]=2

Use the option RandomSeeding to avoid having different results:

Out[3]=3

SpecificityGoal  (1)

Generate data with normally distributed noise:

Visualize the data:

Out[2]=2

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

Out[3]=3

Visualize the fitted functions with the data:

Out[4]=4

TargetFunctions  (1)

Generate data with normally distributed noise:

Visualize the data:

Out[2]=2

Find the best function that approximates data:

Out[3]=3

Find the best function that approximates data using TargetFunctions:

Out[4]=4

Visualize the fitted functions with the data:

Out[5]=5

Applications  (3)Sample problems that can be solved with this function

Population Growth  (1)

Population growth in Poland:

Out[1]=1

Find the best function that describes data:

Out[2]=2

Visualize the fitted function with the data:

Out[3]=3

Find a fit for the first 100 prime numbers:

Out[5]=5

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

Out[7]=7

Differential Equation  (1)

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

Out[4]=4
Out[5]=5

Compare the fit with the data:

Out[6]=6

Orbital Mechanics  (1)

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

Out[2]=2

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

Out[3]=3

Find the constant of proportionality:

Out[4]=4

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

Out[5]=5

The exact constant of proportionality has value:

Out[6]=6

Compare with the different values from the orbital data directly:

Out[8]=8
Wolfram Research (2015), FindFormula, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFormula.html (updated 2017).
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).

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.

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

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

BibTeX

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

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

BibLaTeX

@online{reference.wolfram_2025_findformula, organization={Wolfram Research}, title={FindFormula}, year={2017}, url={https://reference.wolfram.com/language/ref/FindFormula.html}, note=[Accessed: 24-May-2025 ]}

@online{reference.wolfram_2025_findformula, organization={Wolfram Research}, title={FindFormula}, year={2017}, url={https://reference.wolfram.com/language/ref/FindFormula.html}, note=[Accessed: 24-May-2025 ]}