Thread Subject: Curve fitting using Gaussian model

Subject: Curve fitting using Gaussian model

From: Osama Zahran

Date: 12 May, 2008 14:27:04

Message: 1 of 3

Dear Sir/Madam,

In curve fitting toolbox, the Gaussian model is:

Y = a * exp(-((x-b)/c)^2)

and Matlab returns the coefficients a, b and c.
Where a is the amplitude
b is the centriod (location)
c is related to the peak width

The question is: what is the relation between a and c?

Comparing general Gaussian model with the previous model we
find:

c = 1/(a*(sqrt(pi)))

By the returned values for a and c from the fitting process
do not validate this relation.

The general Gaussian model is:

Y = (1/(sigma*(sqrt(2*pi)))) * exp(-((x-b)^2)/((2*sigma)^2))

Subject: Curve fitting using Gaussian model

From: Alessandro Mura

Date: 12 May, 2008 16:06:03

Message: 2 of 3

"Osama Zahran" <zahran@liverpool.ac.uk> wrote in message
<g09k3o$j0f$1@fred.mathworks.com>...
> Dear Sir/Madam,
>
> In curve fitting toolbox, the Gaussian model is:
>
> Y = a * exp(-((x-b)/c)^2)
>
> and Matlab returns the coefficients a, b and c.
> Where a is the amplitude
> b is the centriod (location)
> c is related to the peak width
>
> The question is: what is the relation between a and c?
>
> Comparing general Gaussian model with the previous model we
> find:
>
> c = 1/(a*(sqrt(pi)))
>
> By the returned values for a and c from the fitting process
> do not validate this relation.
>
> The general Gaussian model is:
>
> Y = (1/(sigma*(sqrt(2*pi)))) * exp(-((x-b)^2)/((2*sigma)^2))

Hi,
I guess you already know it, but in your
last equation the coefficient a is expressed
in terms of sigma because the integral of
the function must be 1 (this is, for example,
when you have a normal probability distribution function
like randn). So if you simulate some x=randn(1,N)
and then you calculate the hist(x,...),
and normalize the integral to unity, then the
result can be fitted by a gaussian like
Y = (1/(sigma*(sqrt(2*pi)))) * exp(-((x-b)^2)/((2*sigma)^2))
Otherwise, if you just want to fit some data
with a gaussian fucntion, the amplitude (a) has no
relation with the widht (c).

Regards

Subject: Curve fitting using Gaussian model

From: Peter Perkins

Date: 12 May, 2008 19:51:07

Message: 3 of 3

Osama Zahran wrote:
> Dear Sir/Madam,
>
> In curve fitting toolbox, the Gaussian model is:
>
> Y = a * exp(-((x-b)/c)^2)
>
> and Matlab returns the coefficients a, b and c.
> Where a is the amplitude
> b is the centriod (location)
> c is related to the peak width
>
> The question is: what is the relation between a and c?

Osama, You might find this demo helpful:

<http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/cfitdfitdemo.html>

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
curve fitting using gaussian model O Zahran 12 May, 2008 10:30:26
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com