help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fitting 2d normal distribution


From: Francesco Potorti`
Subject: Re: fitting 2d normal distribution
Date: Tue, 21 Oct 2008 23:33:26 +0200

>> Suppose I have 1d data that I want to fit with a normal distribution.  I
>> just compute mean() and var() and that's all I need to plot a normal
>> distribution fitting my data.

For example, if my data are in the vector X, I do:
mu = mean(X);
st = std(X);
x = linspace(mu-3*st,mu+3*st,100);
plot(x, normpdf(x,mu,st));

>> What about 2d data?  Are there ready-made functions for computing the
>> necessary parameters and plotting the 2d normal pdf?
>
>'mean' and 'cov' ?

How do I use them?  If my data are in the 2d matrix X, how do I plot the
fitting 2d Gaussian pdf or -- better for me -- the contour ellipses?

More precisely, I can do that "by hand", with a little effort, but I
wondered if there were simple ready-made functions to do that.

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]