behaviour of partialcorri: clarification needed
4 views (last 30 days)
Show older comments
Dear everyone,
I have troubles understanding the behaviour of partiacorri function. More specifically, in the following example, I would have expected the variable rho2 to be equal to the second row of the matrix rho, but it is not the case.
load carsmall;
rng('default'); % For reproducibility
Headwind = (10:-0.2:-9.8)' + 5*randn(100,1);
y = [MPG,Acceleration];
x = [Displacement,Horsepower,Weight];
z = Headwind;
[rho,pval] = partialcorri(y,x,z,'Rows','complete')
[rho1,pval1] = partialcorri(y(:,1),x,z,'Rows','complete')
[rho2,pval2] = partialcorri(y(:,2),x,z,'Rows','complete')
which returns:
rho =
0.0572 -0.1055 -0.5736
-0.3845 -0.3966 0.4674
rho1 =
0.0572 -0.1055 -0.5736
rho2 =
-0.4024 -0.3699 0.4567
What am I missing here?
Thanks
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!