Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
8 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. ...
0
votes
0answers
15 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 ...
0
votes
0answers
15 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 ...
0
votes
0answers
14 views

How to improve Pairwise Euclidean Distance for Similarity Measure

I have two DataFrames as below. I have standardized my structured data using (x-mean)/std. ...
0
votes
0answers
20 views

What is the difference between PCA and Mahalanobis? [on hold]

I think the question What's the difference between principal component analysis and multidimensional scaling? is quite similar but I do not see a precise answer there.
0
votes
1answer
40 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 ...
0
votes
0answers
6 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 ...
2
votes
0answers
41 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 ...
1
vote
0answers
8 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 ...
0
votes
0answers
7 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 ...
-1
votes
0answers
17 views

PCA on numerical, ordinal and dichotomous data [duplicate]

I'm new to PCA and basically all the textbook exercises I've done use numerical variables However, I came across a question on PCA with ordinal categorical data (2 variables which represent answers ...
1
vote
0answers
16 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 ...
0
votes
2answers
36 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 ...
-1
votes
0answers
47 views

Error message: Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric [closed]

I'm new to R, and have been trying to run PCA on all the variables. I've included a screenshot of my ...
0
votes
1answer
35 views

Understanding the example in ?prcomp (R)

I'm trying to understand, in simple terms, the following example copied from prcomp in R: ...
0
votes
0answers
16 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. ...
0
votes
0answers
6 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: ...
0
votes
0answers
12 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 ...
0
votes
1answer
29 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, ...
0
votes
1answer
22 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. ...
0
votes
1answer
27 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 ...
0
votes
2answers
51 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 ...
1
vote
1answer
39 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 ...
0
votes
2answers
25 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 ...
0
votes
0answers
14 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 ...
0
votes
2answers
71 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 ...
0
votes
0answers
22 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 ...
2
votes
1answer
18 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 ...
0
votes
0answers
10 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 ...
1
vote
0answers
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 ...
1
vote
0answers
10 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, ...
0
votes
1answer
12 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: ...
0
votes
0answers
26 views

Using numpy SVD to calculate factor loadings [duplicate]

I'm doing PCA (Principal Component Analysis) in Python using the numpys Singular Value Decomposition. Effectively extracting the principal components like so: ...
0
votes
1answer
21 views

How to automatically choose the number of components for PCA?

For PCA, we can print out the number of components vs % variance explained, like in the following picture: And as human practitioners, we're typically instructed to choose the number of components at ...
0
votes
0answers
16 views

Should Principal Component Analysis (PCA) axes always be from 1 to -1?

I see a lot of talks/papers where Principal Component Analysis (PCA) scatter plots have axes that go from numbers OTHER than -1 to 1. I thought that for PCA, the data MUST be unit variance ...
0
votes
0answers
12 views

How to keep the numeric scale for PCA?

I'm doing a 1-component PCAs on individual groups of correlated values with sklearn. mapping=PCA(n_components=1) X_mapped = mapping.fit_tranform(X_group) For ...
0
votes
0answers
15 views

Dimension Reduction for mixed variables

I am working with a dataset which consists of both categorical (14 vars) and continuous variables (5). Each categorical variable consists of a minimum of 2 categories up to 106 categories. The aim ...
0
votes
0answers
21 views

Number of factors in Factor Analysis of Mixed Data with FactoMineR

I'm trying to perform FAMD with FactoMineR because I want to reduce the dimensionality of my data. My data has 378 dimensions and 34K rows. Around 350 of those dimensions are categorical and the rest ...
1
vote
2answers
82 views

For calculating the distance between different points, does it make sense to use all Principal Components?

I have a data frame with about 500 observations and 8 variables that I'd like to run through PCA in order to try and reduce the number of variables to only those with the most variance. From here, I ...
1
vote
0answers
8 views

Find a set of k non-negative vectors that explain most of the variance of the dataset?

I have a set of securities and I am looking for long-only portfolios that explain most of the variance of the set of securities. If it weren't for the long-only requirement, I could have used ...
0
votes
0answers
15 views

When the elements of first basis are always positive for PCA?

I am computing the PCA projection matrix of some data. I notice that the elements of first basis vector (corresponding to the highest eigenvalue) are always positive. My data is real and contain both ...
1
vote
0answers
17 views

Question regarding the Supervised Principal Components method

I'm going over Bair's and Tibshirani's Supervised PC method and looking at their R package tutorial here. In their paper, in the section titled "A Breast Cancer Example," it seems they find the most ...
0
votes
0answers
17 views

PCA/ordination/Correspondence analysis for data with two groupings

I am working with a data set on plant presence-absence within 40 plots. For two years, the presence-absence of all plants were noted in each plot. I would now like to investigate whether the plant ...
1
vote
0answers
23 views

PCA: What does it mean that the number of necessary PCs for a given explanation of variance percentage changes?

I initially asked this question at stackoverflow, but there was no answers. Someone suggested that I ask the question here, and here it follows. Say one has a program that performs PCA. The program ...
0
votes
0answers
31 views

Is it better to interpret PCA components using the eigenvectors or the rescaled loadings?

I have a dataset to which I am applying PCA, and looking to each PCA component. Initially I was using the eigenvectors as a way to understand what each component "means". When using the eigenvectors ...
0
votes
0answers
12 views

Transforming the Kernel principal components to original space

According to my understanding, we obtain the kernel/gram matrix eigenvectors/values in kernel PCA. We can use the kernel matrix for transforming the data however is there a way to transform those ...
1
vote
0answers
10 views

Blind source seperation on space data [closed]

in a uni project we gathered spectrum data from the ISS (time x frequency). The challenge is now to analyse this data and especially try to seperate the signals. As far as I understood it the common ...
1
vote
1answer
24 views

Approaches to reduce dimensions (feature selection/extraction) with high dimensional count data before running tree based model

My dataset has ~100k samples and 3000 dimensions. The data are counts, anywhere between 0-8 and it's pretty sparse. Because of 'curse of high dimension', I want to shrink the number of variables ...
1
vote
1answer
58 views

How to interpret PCA coefficients to reduce dimension

I have read about similar questions. I have data which has 68 columns and about 800 samples. The 68. column is the output the rest 67 is the input variables. I want to reduce the size of my input ...
0
votes
0answers
26 views

eigen function in R

I want to ask about the eigen function of R. I am currently doing a project of NBA team analysis. I am trying to figure out correlation effect of two players lineup ...