help-octave
[Top][All Lists]
Advanced

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

Re: fitting 2d normal distribution


From: Søren Hauberg
Subject: Re: fitting 2d normal distribution
Date: Wed, 22 Oct 2008 09:51:32 +0200

tir, 21 10 2008 kl. 23:33 +0200, skrev Francesco Potorti`:
> >> 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.

I don't think there are any functions for plotting ellipses from
covariance matrices. The statistics package has the
'mvnpdf' (multivariate normal pdf) function that allows you to evaluate
your estimated distribution. Using this you can either generate a 3d
plot using 'mesh' or 'surf', or you can get the contour ellipses using
'contourf'. An alternative (and better, I guess) implementation would
generate the unit circle, and then transform this into the space spanned
by the eigen vectors of your covariance matrix. You could then plot the
transformed circle using 'plot'.

If you end up with a nice implementation, I guess having such functions
in the statistics package might make sense. So, do feel free to
contribute whatever you come up with.

Søren
> 



reply via email to

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