36
$\begingroup$

In version 10.2 there is a new experimental function: FindFormula[].

I suspect that a genetic programming algorithm (symbolic regression) is behind this new feature, but I can't find any references.

Question

  • What is behind this new function?
$\endgroup$
  • 1
    $\begingroup$ It was inevitable that someone would come along and ask this… $\endgroup$ – J. M. will be back soon Jul 17 '15 at 17:04
  • 6
    $\begingroup$ FWIW I used this until it became paid $\endgroup$ – Dr. belisarius Jul 17 '15 at 17:07
  • 2
    $\begingroup$ Quite unlikely; I haven't ever seen them add functions to Alpha at the same time as in a new version of Mathematica. $\endgroup$ – J. M. will be back soon Jul 17 '15 at 17:28
  • 11
    $\begingroup$ I think it builds Ill-formed questions from a cursory scan, posts them here, scrapes any answers, and returns the result.... :-) $\endgroup$ – ciao Jul 17 '15 at 19:12
  • 2
    $\begingroup$ @vonjd Hope you'll get it! There shouldn't be that difficult to be generous $\endgroup$ – Dr. belisarius Jul 18 '15 at 6:43
17
$\begingroup$

The Experimental function FindFormula[] at the moment is using a combination of different methods: it combines non linear regression with Markov chain Monte Carlo methods (e.g. Metropolis–Hastings algorithm). In the future (possibly in V$10.3$) there will be an option allowing the user to choose which method to use.

$\endgroup$
  • 1
    $\begingroup$ Welcome to Mathematica.SE! $\endgroup$ – Michael E2 Jul 22 '15 at 18:25
  • 3
    $\begingroup$ Thank you. How do you know that? Are you in the development team? $\endgroup$ – vonjd Jul 22 '15 at 18:36
  • $\begingroup$ Just found this post. Interesting, Monte Carlo seems to be involved. I have a set of data (not very large, 121 data points) which delivers distinct results every time FindFormula is invoked. I first thought of a bug, but now I see it´s a feature ;-) $\endgroup$ – mgamer Apr 27 '17 at 16:29
6
$\begingroup$

The following reveals definitions

<< GeneralUtilities`
PrintDefinitions@FindFormula

As usual one can click the symbols to find definitions of functions "further down". It should also be noted that FindFormula is listed in the Machine Learning guide, which corresponds to symbol names like SymbolicMachineLearning`PackageScope`ImputArgumentsTestFindFormula shown further down by PrintDefinitions.

$\endgroup$
6
$\begingroup$

I doubt that this is very robust. Consider a simple change in the DE example in the Documentation:

sol = y /. NDSolve[{y'[x] == y[x] Cos[x], y[0] == 2}, y, {x, -5, 300}][[1]];
times = N[Range[-5, 600]/9];
data = Transpose[{times, sol[times] + RandomReal[0.05, Length[times]]}];
lp = ListPlot[data, PlotRange -> All]

Now

FindFormula[data, x, 1, TargetFunctions -> {Exp, Sin, Cos}]

thinks the best solution is 2.27414 Sin[x] + 2.5479. Whereas a much better solution, obviously compatible with the selected TargetFunctions, is 2 Exp[Sin[x]].

$\endgroup$
  • $\begingroup$ On the other hand, is FindFormula[] even smart enough to consider composing TargetFunctions? $\endgroup$ – J. M. will be back soon Jul 27 '15 at 13:47
  • 4
    $\begingroup$ You don't need to change the DE to get this. The behaviour is the same with the original. Every time I run it I get a different result, and that result is sometimes $e^{\sin{x}}$. The same with the modified one: put it in a Table[..., {20}] and very likely at least one of the results will be $2 e^{\sin x}$. (But requesting 20 functions within the FindFormula doesn't work nearly as well.) $\endgroup$ – Szabolcs Jul 28 '15 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.