help-octave
[Top][All Lists]

## Re: Plotting a principal component analysis with contours

 From: Johan Kullstam Subject: Re: Plotting a principal component analysis with contours Date: 06 May 2001 21:13:30 -0400 User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

```"Gerrit J. Kiers" <address@hidden> writes:

> Hello all,
>
> I want to use Octave to plot a principal component analysis, including
> contour ellipses around the data for say 75%, 90% and 95% probabilities.
> I use sources that have been published on this list in early 1999 (see
> 130.txt, 131.txt and 143.txt in the 1999-archive). A contour is plotted
> using the 2x2 covariance matrix with function file 'ellipse.m' (contribution
> of John W. Eaton).
>
> I lack the mathematical background required for determining the right values
> for 'level' for the different probability contours. Level is a multiplier
> (variable) in 'ellipse.m'. It is multiplied with the square root of the
> eigenvalues.
>
> I assume that the probability along the two principal axis of the ellipse
> can
> be calculated with:
> > normal_pdf(*somethingtodowitheigenvalue*,Mean_t(1,1),Var_t(1,1) )
> and
> > normal_pdf(*somethingtodowitheigenvalue*,Mean_t(1,2),Var_t(1,2) )
>
> But I cannot get my finger behind it. Frankly: I have no clue about
> Eigenvalue. And I've not found an statistical book or handbook on multi
> variate analysis that I can access easily to solve my questions. Please
> help me on this.

i wouldn't use eigenvalue.  i'd use the singular value decomposition.
while eigenvalue and SVD give the same answer, SVD puts the values in
descending order and SVD makes for a much cleaner derivation.  for
canonical variate analysis, you almost have to go with SVD.  tw
anderson's eigenvalue derivation for CVA is imho incomprehensible.

anyhow, once you do an SVD you can look at the problem as multiple
one- dimensional gaussians.  solve the 1D cases to get spheres of
confidence intervals.  use the SVD mapping to get elipses in the
original vector space.

--
J o h a n  K u l l s t a m
Don't Fear the Penguin!

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```