How to rotate the field vectors in the minimum covariance direction?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a magnetic field data (n by 3 components) and i wish to find its covariance matrix and obtain eigen values, eigen vectors.
Now how to rotate this magnetic field vectors in the minimum covariance direction?
I attempted the following steps to obtain eigen values and eigen vectors:
Bxyz is nX3 matrix.
covx = cov(Bxyz(:,:));
[ei_vec,ei_val,explained] = pcacov(covx);
[min_eival id_min_eival] = min(ei_val);
MVDir = ei_vec(id_min_eival,:);
0 comentarios
Respuestas (1)
Shashank Gupta
el 22 de Oct. de 2020
Hi Megha,
I am assuming the minimum covariance direction here means the direction in which the spread(variance) of data is least. I am not really sure why do you want to rotate, may be you want to project the data in that direction (that would make sense), not the rotatation as such. For now let's just assume you want to project the magentic field data in the min covariance direction, You already found the least eigen value and the corresponding eigen vector, Now you simple need to project that data, you can do so,
BxyzTransformed = MVDir'*Bxyz
And even you can find the transformed covariance matrix by,
covxTransformed = MVDir'*covx*MVDir
I hope, I understood your question properly or atleast the intention.
Cheers
0 comentarios
Ver también
Categorías
Más información sobre Cartesian Coordinate System Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!