Bug introduced in 10.2 and fixed in 10.3
In the documentation of FindFormula
, the first application of it is to predict the population of Poland.
data = EntityValue[Entity["Country", "Poland"],
EntityProperty["Country",
"Population", {"Date" ->
Interval[{DateObject[{1950}], DateObject[{2015}]}]}]]
fit = FindFormula[data, x]
However, when I tried to run the code, it did not work and gave the following error:
FindFormula::wrgfmt: Argument {{QuantityMagnitude[Sun 1 Jan 1950 00:00:00GMT+8.],2.4824*10^7},{QuantityMagnitude[Mon 1 Jan 1951 00:00:00GMT+8.],2.52623*10^7},<<47>>,{QuantityMagnitude[Fri 1 Jan 1999 00:00:00GMT+8.],3.8336*10^7},<<16>>} at position 1 does not have the right format. Data should be a numerical array of depth less or equal than 2. >>
It seems that QuantityMagnitude
cannot deal with that DateObject
, but AbsoluteTime
will do the job. My idea to fix this is to change some Mathematica code in FindFormula
. I tried Information[FindFormula]
, but it returned a lot of private packages, and I don't know how to track down then. Is there any workaround to get FindFormula
to work with these population data?
AbsoluteTime[]
instead and fitting with that? $\endgroup$FindFormula
is experimental. I guess that means "beta", and the docs are out of sync with the development. Many of the otherFindFormula
documentation examples don't give the same output that's shown in the documentation. $\endgroup$fit = FindFormula[data // Normal, x]
. I can't test this, I don't have V10.2 $\endgroup$FindFormula
uses stochastic algorithms with randomized seeds. There is a"RandomSeed"
option that should make the function give the same answers always, but it's currently not working properly. $\endgroup$FindFormula
in 10.2 which we are aware of. $\endgroup$