# Questions tagged [pca]

Principal component analysis (PCA) is a linear dimensionality reduction technique. It reduces a multivariate dataset to a smaller set of constructed variables preserving as much information (as much variance) as possible. These variables, called principal components, are linear combinations of the input variables.

2,526 questions
Filter by
Sorted by
Tagged with
17 views

### Dimension Reduction on Data with both Spatial and Non-Spatial Variables to Train a Logistic Regressor for Cross Sectional Time Series Data

I need some help on how to process and analyse a study of mine. I'm running a study on mice to look at the effect of diet on cells over a series of time. My mice are divided into two groups, one group ...
21 views

### How do you actually use PCA in MATLAB?

I'm trying to use the pca command in MATLAB for dimensionality reduction. I know that [U, V] = pca(X) will yield the principal components in U and the scores in V,...
32 views

### How to include percentage variables in PCA + K-means when some values are undefined because the denominator is 0?

I'm trying to do customer segmentation by using PCA to reduce dimensionality and then feeding the resulting principal components into a K-means algo to get at the final segments. Some of my variables ...
347 views

### sklearn::PCA, Inverse transform(transform(X)) = X?

I want to know why doing inverse_transform(transform(X)) $\ne$ X? In the below code, I do the following: I import the iris dataset, drop the target, select three samples. Fit the full data to a PCA ...
50 views

### Comparing PCA results between two groups in normalized space

I've conducted a PCA analysis of n-anthropometric measures on separate sets of male and female data. Before analysis, these data were normalized within each group such that mean = zero and SD = 1. ...
26 views

### Do the criteria for factor retention apply equally to component retention?

I'm familiar with aspects of the received wisdom about the selection of the number of factors in factor analysis. For example, Wikipedia suggests that Horn's parallel analysis is a good method, and ...
19 views

### PCA plot does not show a statistical difference even though the single factor MANOVA was used

My single factor MANOVA showed that there is a statistical difference between the red and black (which represent the effect of treatment given) : the P value was <0.05. But in PCA there seems to ...
30 views

### Is euclidean distance in pca rotated and scaled when $n < p$ the same for all observations?

I am trying to come up with an appropriate measure of the 'distance to the normal mean' in high dimensional space and I came up with a strange result, and I need some theoretical background to ...
14 views

### Should I standardize all variables before a PCA separately if some share the same units

I have a matrix that contains >2000 variables which can be divided in 4 groups of ~500 variables with each group having a distinct unit. I need to standardize the matrix before running a PCA, but when ...
76 views

### Multidimensional Principal Component Analysis

I found a lot of question about principal component analysis as well as functional PCA but only in the sense of time series and not in spatial case and multidimensional principal component analysis. ...
18 views

### ANOVA: single or combined statements

I want to test a hypothesis that states that country of origin significantly influences the consumers' price perception of electronics 'Made in Country X'. In my data, i have four questions measuring ...
18 views

### Why are these low-variance principal components correlated among subjects?

I'm analyzing some body tracking data. Beginning with velocity data from each upper-body joint, PCA is run on about 15 minutes (~1000s of frames) of this tracking data for 24 participants. Out, we get ...
112 views

19 views

### Denoising and pre-images in Kernel PCA

In "Pattern Recognition and Machine Learning" by Bishop, the following problem about Kernel PCA is laid out : In linear PCA, we can approximate data points by projecting them onto the $L < D$-...
100 views

### Calculating RMSEC and RMSECV of PCA in R

I have been trying to calculate the root mean squares error of calibration (RMSEC) and the root mean squares error of cross validation (RMSECV) for a PCA model made in R using the mdatools package. ...
18 views

### Different set of predictors significant for different sample sizes - how to interpret results?

So I am trying a GARCH framework with external regressor(s) to predict returns. The external regressor, $y$, intuitively has useful lags that could predict the response. I'm slowly accumulating data ...
148 views

### How to improve Pairwise Euclidean Distance for Similarity Measure

I am trying to identify the most similar stations between two DataFrames like below: ...
70 views

### PCA based on group variables in R

I have a dataset containing 144 variables in 12 different groups. For example, the first 12 variables belongs to the group of industrial Production and the following 12 variables are taken from ...
146 views

### SVD matrixes do not coincide with Eigen decomposition for covariance matrix [duplicate]

I am comparing the output from the singular value decomposition with the eigendecomposition of the covariance matrix (symmetric matrix). I am expecting that the Eigenvector and a non-diagonal matrix ...
46 views

### Can singular spectrum analysis (SSA) be used on principal component scores for multivariate non-stationary time series?

I have a multivariate time series, space and time data. I want to find the spatial and temporal patterns in the groundwater level data. After consulting a book, the procedure I have opted right now is ...
50 views

### Principal Components' relation with variables having lower variance

This is a philosophical question about PCA, and not a direct coding question. I understand that PCA is a dimensionality reduction technique which results in a certain set of PCs, each PC being a ...
10 views

### How can I implement this Robust PCA equation in a more efficient way?

I recently learned in class the Principle Component Analysis method aims to approximate a matrix X to a multiplication of two matrices Z*W. If X is a n x d matrix, Z is a n x k matrix and W is a k x d ...
8 views

### Should I normalise my data for PCA, Sammon and SOM mapping? [duplicate]

I do not think I need to log-transform my data as the distribution of the components are not skewed. However, the scale of the components are different (i.e. Age, resting blood pressure, maximum heart ...
30 views

### Partial Least Square vs Principle Component Regression

Is it the case where PLS, when compared to PCR with all things equal, generally gives lower bias but higher variance when regressed against a response Y, since PLS relates to/makes use of Y but PCR ...
55 views

### How to get PCA of the testing data? [duplicate]

I'd like to transform my data into pca (preprocessing data before I use data into classification model). I separate my data into data training and data testing. I used princomp in R to process pca ...
88 views

### Understanding the example in ?prcomp (R)

I'm trying to understand, in simple terms, the following example copied from prcomp in R: ...
19 views

### Clustering Principal Components

I would like to group principal components based on sample values. That is, for a matrix with columns (PC1, PC2, ... , PCn), and rows with transformed values, I want to group PCs with similar values. ...
12 views

### Why do I get an error with this data using principal axis factoring but not minimal residual factoring?

I am using n_factors() from the "psycho" package in R to figure out the number of factors for a set of data. When I use prinicipal axis factoring I get the following error: ...
19 views

### How can I recover full dimensional VAR model coefficients after fitting a VAR model to a dimensionality reduced (via PCA) dataset?

I am using PCA to reduce dimensionality prior to fitting a multivariate time-series dataset to a VAR (vector autoregressive) model. Is there any way to convert a PCA-derived VAR model to a full ...
45 views

### Factor Analysis: Single variable contributing to several latent variables

I was wondering whether factor analysis is right tool in my scenario. That is, I have dataset $X = (X_1, X_2, X_3, X_4)$, where $X_i$ denotes a single variable. As far as I understand factor analysis, ...
40 views

### Principal component weights flipped after PCA

I am trying to extract the principal components from a dataset, but the eigenvectors and eigenvalues aren't aligned as I would expect them to be. Here's a simple example to illustrate. ...
30 views

### Is it legitimate to use PCA on scale totals (rather than individual questions) to uncover latent variables (Social Science/Psychology)?

I believe a latent self-control variable may be at the root of plenty of the variation I see in my dependent variable. However, I am using a secondary dataset and do not have access to individual ...
61 views

### What is the meaning of these principal components?

I have a matrix of data. I computed the principal components of my matrix using SVD (code shown below): subtract mean...then $$[U,S,V] = SVD({\rm matrix})$$ for $V$, which is the principal ...
166 views

### SVD PCA reconstruction of data [duplicate]

I have some data about the $\{noise,~ size,~ speed,~ length,~ width\}$ of cars. I have performed SVD, and I want to reconstruct my data using only the first 2 principal components. I subtracted mean ...
52 views

### Does it make sense to apply PCA or Z-Score to any dataset?

Suppose we have a given dataset whose variables represent different things. For instance, one of them could represent the time a user spends on the phone while another one can represent the continent ...
103 views

### How do you perform a good Dynamic principal component analysis (DPCA) in R?

I have a spatiotemporal data (time series of 20 variables). I want to reduce its dimension using techniques such as PCA. However, traditional PCA assumes that the observations (in this case, values ...
86 views

### Are there any advantages to using all principal components vs. all original variables?

Are there ever any advantages to using all principal components vs. all original variables for any analysis? For the sake of this question, let's assume that it's either one or the other, so there ...
24 views

### Is it right to use PCA in this scenario?

Physicist here. I have a dataset. The data is the emission from a molecule that has two dipoles. Molecules can only emit along these dipoles. As I rotate the molecule, I will selectively excite the ...
47 views

### Interpolating principal component

In my thesis, I use PCA from a bunch of WVS responses to measure the social capital of a country (aggregating principal components to country averages). However, WVS provides a quite low frequency of ...
12 views

### Chossing between high number of components in PCR vs linear regresion

Let's say my original data set has 18 variables. If the result of the cross-validation error is lowest on the 17 components of PCR is that a good indication that you most likely choose the ...
15 views

### Use historical data to build surface with limited number of points [closed]

Lets say I have historical surfaces of data which vary slightly during time, but keeps similiar dynamics. I would like to use these historical data sets to estimate todays surface (given a limited ...
11 views

### Is eigenspace based classification possible

Imagine I would like to classify an image (e.g. into healthy and sick) and have a lot of labeled data. Could I classify any image by comparing it to the eigenspaces of the two sets? It sounds simple, ...
52 views

### What is the formula for calculation of R_ij in numpy.corrcoef(x, y, rowvar = False)?

The manual does not provide the formula if we pass x and y. I do not understand the matrix I get. Here is my code: ...