0

For X = (X1, X2, X3) distributed as N3(µ, Σ), mean of the original data is mu and variance-covarinace matrix of the original data is Sigma. I found in this section that we can derive the variance-covariance matrix of the Principal component using eigen vectors. Can I use that (variance-covariance matrix of the Principal component) to sketch the ellipse in 2d space? How to do it in R? I was stuck after below code.

X  <- mvrnorm(n=100, mu=c(1,-1,2), Sigma=matrix(c(1,-0.57,0,-0.57,1,-0.57,0,-0.57,1), ncol=3))
lambda <- eigen(Sigma)$values
Gamma  <- eigen(Sigma)$vectors

P is the principal component. P = (p1,p2)

Orginal data is of 3 variable and PC is of 2 variable.

Ellipse to sketch is (p - $\mu$$_p$ )$^T$ Sigma$_p$ $^-$$^1$(p-$\mu$$_p$)=c^2

also c is const, Then by adjusting the value of it (where ellipse has 0.84 probability) plot has to done w.r.t to the joint distribution of P.

I read here that PC vectors will be the same regardless of how many times you apply the transformation. What about variance-covariance matrix that got after PCA?

Karolis Koncevičius
  • 4,282
  • 7
  • 30
  • 47
StatsMonkey
  • 150
  • 1
  • 7
  • https://stats.stackexchange.com/questions/24380 answers your question. (Although it focuses on Normal distributions, you can see by reading the answer that it's really only about drawing an ellipse given by its center $\mu$ and coefficients $\Sigma^{-1}.$) Also see https://stats.stackexchange.com/questions/9898/, https://stats.stackexchange.com/questions/153564, and [this site search](https://stats.stackexchange.com/search?tab=votes&q=%5br%5d%20ellipse%20). – whuber Apr 11 '20 at 14:45
  • @whuber much thanks for the reference. May I know how Σ (variance cov matrix) of principal component is computed as a 2x2 matrix to apply here? Is that matrix is created just by substituting eigen values in diagonal? – StatsMonkey Apr 11 '20 at 15:25
  • Does this answer your question? [How to get ellipse region from bivariate normal distributed data?](https://stats.stackexchange.com/questions/24380/how-to-get-ellipse-region-from-bivariate-normal-distributed-data) – kjetil b halvorsen Apr 11 '20 at 17:23
  • @kjetilbhalvorsen ... It has the method to sketch. I got the method for original data (X) from there. But my question is how to do it for the principal component (P)? The variance cov matrix) of principal component has to give as a parameter for that. How to get variance cov matrix of principal component then? – StatsMonkey Apr 12 '20 at 03:28
  • I applied Sigmaz – StatsMonkey Apr 12 '20 at 15:49

0 Answers0