Questions tagged [principal-components]

Performs a principal components analysis on the given data matrix and returns the results as an object of class prcomp.

The princomp( ) function produces an unrotated principal component analysis.

Performs a principal components analysis on the given data matrix and returns the results as an object of class prcomp.

32 questions
1
vote
2 answers

Accessing Percentage of Variation Explained in PCR Regression in R

I'm just wondering how to access the percentage of variation explained and cross-validated test error after using a PCR regression. I've looked at the documentation for summary.mvr, but I think I must be missing something. Is there an easy way to do…
Vincent
  • 7,808
  • 13
  • 49
  • 63
1
vote
1 answer

Total Least squares regression without intercept, with R

I need to calculate the beta of a regression between two prices with: No intercept Using Total Least Squares estimate In R there is the function prcomp to perform it. After it, how can I extract the beta? the code is `library(quantmod) # how to…
gcats
  • 41
  • 6
1
vote
0 answers

Using PCA in OpenCV for rotation invariant character recognition

I'm currently trying to identify a character based on an 8 bit matrix which I've extracted around a tag as part of my program (I've called this matrix "tag_character" and an example image of the "D" character is below). Because I need…
Jack Simpson
  • 1,681
  • 3
  • 30
  • 54
1
vote
1 answer

PCA projection plot with ggplot2

I have a plot which demonstrates the idea of projection of points onto the axis with greatest variance. The code in R is pasted below and I need an initial pointer how to reproduce this plot in ggplot2. # Simulate…
Andrej
  • 3,719
  • 11
  • 44
  • 73
1
vote
1 answer

Principal Component Analysis in java

I am trying to achieve multiplication in array for doing PCA in java I calculated mean and substrtacted it from each x values.Next I need to find covarience So inorder to find that I need to multiply all the combinations in a given array [a,b,c]…
USB
  • 6,019
  • 15
  • 62
  • 93
1
vote
1 answer

Which variables combine to form most of the variance for a principal component in PCA?

I get how PCA works and how to implement it in Matlab, but I'm at a loss to find out which variables contribute most strongly to a principle component. My questions is, suppose I have a data set of variables A,B,C,D,E,F. Unknown to me, variables…
ndb
  • 127
  • 1
  • 10
1
vote
3 answers

principal component variance given by eigenvalue for principal eigenvector

in Principle Component Analysis I was wondering why the data projected onto the principle component has variance by the eigenvalue corresponding to the principle eigenvector? I can't find the explanation in my textbook.
0
votes
1 answer

1st principal component of 3 points on a line

I am a little bit confused on the first principal directions. Say I have three points in a two dimensional euclidean space: (1,1), (2,2), and (3,3) and I want to calculate the first principal component. First I see that the center is (2,2) so I…
Mr.Roboto
  • 191
  • 3
  • 14
0
votes
1 answer

Why 'pca' in Matlab doesn't give orthogonal principal components?

Why using pca in Matlab, I cannot get the orthogonal principal component matrix For example: A=[3,1,-1;2,4,0;4,-2,-5;11,22,20]; A = 3 1 -1 2 4 0 4 -2 -5 11 22 20 >> W=pca(A) W = 0.2367 0.9481 …
Zepeng Huo
  • 23
  • 5
0
votes
0 answers

How to make sense of principal component analysis (PCA) in MATLAB

I have a data set of 3 different variables, each variable has 37 data points as follows: Variable_1 = [0.489274770173646 0.534659090909091 0.496806966618287 0.593160935871933 0.542091836734694 0.514607775477341 0.580715497052410 …
chinkare_16
  • 135
  • 7
0
votes
0 answers

1st PC irregular in Supervised Principal Component Analysis

I am using superpc package to carry out supervised principal component analysis on my data. I am using the following link as reference http://statweb.stanford.edu/~tibs/superpc/tutorial I am using regression analysis for my data. When I plot the…
Sid411
  • 703
  • 2
  • 9
  • 25
0
votes
2 answers

Don't understand the output of Principal Component Analysis (PCA) in Python

I did a PCA in Python on audio spectrograms and face the following problem: I have a matrix, where each row consists of flattened song features. After applying PCA it's clear to me, that the dimensions are reduced. BUT I can't find those dimensional…
Jamona
  • 97
  • 1
  • 11
0
votes
1 answer

Principal component function Incanter

I have been trying to use the principal-components function from Incanter to do PCA and seem to be off track in using it. I found some sample data online from a PCA tutorial and wanted to practice on it: (def data [[0.69 0.49] [-1.31 -1.21] [0.39…
sunspots
  • 1,047
  • 13
  • 29
0
votes
1 answer

Principal Components in SAS

I have written the following in SAS: data test; infile 'C:\Users\Public\Documents\test.dat'; input a b c d e id; run; proc princomp cov out=a; var a b c d e; run; proc corr; var prin1 prin2 prin3 a b c d e; run; Is there a way to list…
user21478
  • 155
  • 2
  • 3
  • 10
0
votes
2 answers

Principal Component Analysis (PCA) - accessing shape

I am a beginner in python and I am trying to apply Principal Component Analysis (PCA) to a set of images. I want to put the images in a matrix to be able to perform PCA. I am still at the beginning but I am having errors. import numpy as np import…
user2229953
  • 1,569
  • 3
  • 16
  • 24