The maths in expfitbm
The drift model
y(t) = a + b t + c exp[-d t]
has the disadvantage that the minimum finder of
sumt (Yt - y(t))2
can get stuck on negative values of d.
So that we use a mapping of d assuring an ever decreasing exponential:
d -> arctan(d) + π/2
See C:\hgs\Mathematica\ExpFit-ImprovedEq.nb
Fortran code in ~/tap/p/expfits.f
and ~/tap/mo/expfitbm.f
Calculation of the uncertainty of the
parameters:
- Compute the RMS of the best fit: RMSb
- Compute the 95% width of the χ2
distribution: r
- For what value of pj
is RMS = r*RMSb
?
(Carried out with bisection)
NB: The residual is almost certainly not white!