You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Christoph Läubrich <la...@googlemail.com.INVALID> on 2020/05/25 05:27:29 UTC

[math] Question about GaussianCurveFitter.ParameterGuesser

I'm currently looking into some curve-fitting and have examined the

basicGuess(WeightedObservedPoint[])

in GaussianCurveFitter.ParameterGuesser, and there is one thing I don't 
really understand.

in Line 301 [1] the "halfY" is computed by n (what is the maximal y 
value of the observation) + half the sum of n+m (where m is the x value 
of the maximum) applying this to some of my datapoints that fit 
relatively good as a Gaussian later, it seems that this condition never 
works, and the default in the catch clause is used instead.

I also wonder why x is taken into account for computing the half-y value..

thanks in advance.


[1] 
https://github.com/apache/commons-math/blob/master/src/main/java/org/apache/commons/math4/fitting/GaussianCurveFitter.java#L301

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Question about GaussianCurveFitter.ParameterGuesser

Posted by Gilles Sadowski <gi...@gmail.com>.
Hello.

Le lun. 25 mai 2020 à 07:27, Christoph Läubrich
<la...@googlemail.com.invalid> a écrit :
>
> I'm currently looking into some curve-fitting and have examined the
>
> basicGuess(WeightedObservedPoint[])
>
> in GaussianCurveFitter.ParameterGuesser, and there is one thing I don't
> really understand.
>
> in Line 301 [1] the "halfY" is computed by n (what is the maximal y
> value of the observation) + half the sum of n+m (where m is the x value
> of the maximum) applying this to some of my datapoints that fit
> relatively good as a Gaussian later, it seems that this condition never
> works, and the default in the catch clause is used instead.
>
> I also wonder why x is taken into account for computing the half-y value..

Good question indeed.  I don't see why the estimation of the
half-width would change depending on the position of the curve
along the x-axis.
Also it seems that the current code could be made more robust by
shifting the abscissa of the maximum height to 0 before performing
the rest of the computation.

Could you please file a report on the bug-tracking system?[1]

Thanks,
Gilles

[1] https://issues.apache.org/jira/projects/MATH

> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org