Package rrcov, functions PcaCov, PcaHubert, PcaGrid

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Package rrcov, functions PcaCov, PcaHubert, PcaGrid

albina1985
Hello,

I'm using the R-2.13.1 version in Windows and I'm trying to do a robust Pca with the following:

x<-matrix(0.5,30,30)
library("rrcov")

y<-PcaCov(x)

The following error occurs:
Error: diff(sv)<0 ist not all TRUE

The same error occurs with the other functions. What does this mean and how can I perform the robust PCA with these functions by using a quadratic matrix as input?

Thanks in advance,
Albina.
Reply | Threaded
Open this post in threaded view
|

Re: Package rrcov, functions PcaCov, PcaHubert, PcaGrid

Mark Difford
On Jul 13, 2011; 12:03pm Albina wrote:

> Error: diff(sv)<0 ist not all TRUE
> ... . >snip<
> The same error occurs with the other functions. What does this mean and how can I perform the robust
> PCA with these functions by using a quadratic matrix as input?

Albina,

You at least need to feed it something sensible. Look at your matrix:

x<-matrix(0.5,30,30)
x

Try the following:
x <- rmultinom(30, size = 30, prob=rep(c(0.1,0.2,0.8), 30))
PcaCov(x)

Regards, Mark.
Mark Difford (Ph.D.)
Research Associate
Botany Department
Nelson Mandela Metropolitan University
Port Elizabeth, South Africa
Reply | Threaded
Open this post in threaded view
|

Re: Package rrcov, functions PcaCov, PcaHubert, PcaGrid

albina1985
Ok, thank you Mark.

I also found out, that it is not a good idea to perform a Pca with the equal numbers of observation and variables. It is preferable to have much more observations.

Regards,
Albina.