You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "B.Kumar" <ku...@panasys.com> on 2012/05/13 09:06:58 UTC

[math] Gaussian fitter problem

Hi!
I am using the gaussian fitter. Occasionally, I see that the gaussian 
curve that it generates goes negative - undershoots the x-axis. How do I 
avoid this?
Please see the attached plot (using JFreeChart).
Thanks in advance for your help.
B.Kumar



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


Re: [math] Gaussian fitter problem

Posted by "B.Kumar" <ku...@panasys.com>.
Thanks Ted!
That was exactly the problem. I am using JFreeChart's spline renderer, 
and it was going below the x-axis. Will figure out a way to fix this.
Thanks again.

On 5/13/2012 10:42 AM, Ted Dunning wrote:
> Your question lacks enough details to be certain about what you are doing but if  you are fitting a Gaussian distribution defined by exp(-(x-m)^2/(2 s^2))/z then the result can't be negative no matter what.
>
> It is possible that your calculation of the gaussian is buggy.  Or it is possible that your plotting is broken. That can easily happen if you are using splines to smooth your plot.
>
> Sent from my iPhone
>
> On May 13, 2012, at 12:06 AM, "B.Kumar"<ku...@panasys.com>  wrote:
>
>> Hi!
>> I am using the gaussian fitter. Occasionally, I see that the gaussian curve that it generates goes negative - undershoots the x-axis. How do I avoid this?
>> Please see the attached plot (using JFreeChart).
>> Thanks in advance for your help.
>> B.Kumar
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Re: [math] Gaussian fitter problem

Posted by Ted Dunning <te...@gmail.com>.
Your question lacks enough details to be certain about what you are doing but if  you are fitting a Gaussian distribution defined by exp(-(x-m)^2/(2 s^2))/z then the result can't be negative no matter what. 

It is possible that your calculation of the gaussian is buggy.  Or it is possible that your plotting is broken. That can easily happen if you are using splines to smooth your plot. 

Sent from my iPhone

On May 13, 2012, at 12:06 AM, "B.Kumar" <ku...@panasys.com> wrote:

> Hi!
> I am using the gaussian fitter. Occasionally, I see that the gaussian curve that it generates goes negative - undershoots the x-axis. How do I avoid this?
> Please see the attached plot (using JFreeChart).
> Thanks in advance for your help.
> B.Kumar
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 

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


Re: [math] Gaussian fitter problem

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
Hello.

> I am using the gaussian fitter. Occasionally, I see that the
> gaussian curve that it generates goes negative - undershoots the
> x-axis. How do I avoid this?
> Please see the attached plot (using JFreeChart).

There is no attachement.
[Maybe that the list forbids it (?).]


Regards,
Gilles

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