0
$\begingroup$

Im following this example, up to a point where the guy visualises the PCA using biplot function. Just before that he uses ggplot to plot PCA results (PC1 x PC2) and adds, for each category, probability ellipses to it.

Imagine some new data arrives, we calculate PCA results and want to tell whether it falls within the probability ellipse drawn before. Is it possible to do it in R ?

Additional info:

Im so deep into this just need someone elses opinion on whats the best way to do this. The scenario is quite simple : we add new data to iris dataset and I would like to know wehther the new data points are outliers, i.e. fall out of the ellipse generated by the initial/base dataset.

I guess I could get the new result set points (x;y), get the formula of the ellipse and with some help of math magic check whether the new points fall inside (or on) the ellipse.

$\endgroup$
3
  • 1
    $\begingroup$ I had a similar issue some time ago [1] - you can use the workings here to determine the answer to your question: [stats.stackexchange.com/questions/60011/… $\endgroup$ May 3 '17 at 15:17
  • $\begingroup$ Thanks @conjectures , I had a quick look and in one of the comments this thread is mentioned : stats.stackexchange.com/a/24393/919 It looks like people are talking and suggesting what I need. The problem is, and I should have mentioned this in my question, my level of understanding this domain isn't great. I shall play around with the answers and see where I can get. Meanwhile any simpler explanations welcome. Thanks $\endgroup$ May 3 '17 at 20:35
  • $\begingroup$ Neil, the code isn't difficult to write in R, once you wrap your head around the concept. Essentially, you need to apply a transformation to the proposed point which takes ellipses to circles and determine if the point lies within the desired circle or not (the desired circle being your x% probability contour). $\endgroup$ May 4 '17 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.