# Apliying PCA to two correlated stochastic processes

Hello everyone, I have two matrices of size 9*51, meaning that I have 51 measurements of a stochastic process measured at 9 times, being precise, it is wind speed in the direction X, I have the same data for the direction Y. I am aware that both stochastic processes are not independent, so I would like to use PCA over both of them at the same time. My software of choice is Matlab.

I cam perform the PCA analysis simply as:
[coeffU, scoreU, latentU, tsquaredU, explainedU, muU]=pca(U,'Centered',false), however, if I try to execute it over UV, being UV equal to cat(3,U,V), it doesn't work.

Can anyone tell me if there is a way of finding the joint main directions of variation instead of having to compute each one apart?

I am very familiar with MATLAB and with PCA, but not with MATLAB's PCA. (I use the SVD functions.) Which toolbox is PCA in?

I ask because I'm not sure if you have small syntactic problem with the PCA function or a deeper problem (which is being exposed by the difficulties with the PCA function) in the formulation of the question. For instance, often, MATLAB's matrix factorization functions refuse to work with 3-D arrays, so CAT(3,...) would always fail.

• Frank Einstein
I am very familiar with MATLAB and with PCA, but not with MATLAB's PCA. (I use the SVD functions.) Which toolbox is PCA in?

I ask because I'm not sure if you have small syntactic problem with the PCA function or a deeper problem (which is being exposed by the difficulties with the PCA function) in the formulation of the question. For instance, often, MATLAB's matrix factorization functions refuse to work with 3-D arrays, so CAT(3,...) would always fail.

Second, this has all the info regarding Matlab PCA that I am aware of: https://fr.mathworks.com/help/stats/pca.html

And third, I am posting this because I know that Mathematica can do this (see attached images). I have tried to calculate the same on Matlab since I don't want to switch between programs.

https://ibb.co/fUGAjo
This is the attempt in Matlab

https://ibb.co/eYBPc8
And this is in Mathematica.

You are right in the fact that cat(3,...) doesn't work, so that's my problem. Are you aware of any kind of solution to circumvent it and do as I have done on Mathematica.

Thanks again