Description Usage Arguments Details Value See Also Examples
NOTE THAT THIS FUNCTION DOES NOT CENTER NOR SCALES THE MATRICES! Any normalization you will have to do yourself. It is best practice to at least center the variables though.
1 2 |
X |
Numeric matrix. Vectors will be coerced to matrix with |
Y |
Numeric matrix. Vectors will be coerced to matrix with |
n |
Integer. Number of joint PLS components. Must be positive! |
nx |
Integer. Number of orthogonal components in X. Negative values are interpreted as 0 |
ny |
Integer. Number of orthogonal components in Y. Negative values are interpreted as 0 |
stripped |
Logical. Use the stripped version of o2m (usually when cross-validating)? |
p_thresh |
Integer. If |
q_thresh |
Integer. If |
tol |
double. Threshold for power method iteration |
max_iterations |
Integer, Maximum number of iterations for power method |
If both nx
and ny
are zero, o2m
is equivalent to PLS2 with orthonormal loadings.
This is a ‘slower’ (in terms of memory) implementation of O2PLS, and is using svd
, use stripped=T
for a stripped version with less output.
If either ncol(X) > p_thresh
or ncol(Y) > q_thresh
, an alternative method is used (NIPALS) which does not store the entire covariance matrix.
The squared error between iterands in the NIPALS approach can be adjusted with tol
.
The maximum number of iterations in the NIPALS approach is tuned by max_iterations
.
A list containing
Tt |
Joint X scores |
W. |
Joint X loadings |
U |
Joint Y scores |
C. |
Joint Y loadings |
E |
Residuals in X |
Ff |
Residuals in Y |
T_Yosc |
Orthogonal X scores |
P_Yosc. |
Orthogonal X loadings |
W_Yosc |
Orthogonal X weights |
U_Xosc |
Orthogonal Y scores |
P_Xosc. |
Orthogonal Y loadings |
C_Xosc |
Orthogonal Y weights |
B_U |
Regression coefficient in |
B_T. |
Regression coefficient in |
H_TU |
Residuals in |
H_UT |
Residuals in |
X_hat |
Prediction of X with Y |
Y_hat |
Prediction of Y with X |
R2X |
Variation (measured with |
R2Y |
Variation (measured with |
R2Xcorr |
Variation (measured with |
R2Ycorr |
Variation (measured with |
R2X_YO |
Variation (measured with |
R2Y_XO |
Variation (measured with |
R2Xhat |
Variation (measured with |
R2Yhat |
Variation (measured with |
ssq
, summary.o2m
, plot.o2m
, crossval_o2m
1 2 3 4 5 6 7 8 9 10 | test.data <- scale(matrix(rnorm(100)))
hist(replicate(1000,
o2m(test.data,scale(matrix(rnorm(100))),1,0,0)$B_T.
),main='No joint variation',xlab='B_T',xlim=c(0,0.6));
hist(replicate(1000,
o2m(test.data,scale(test.data+rnorm(100))/2,1,0,0)$B_T.
),main='B_T = 0.5 \n 25% joint variation',xlab='B_T',xlim=c(0,0.6));
hist(replicate(1000,
o2m(test.data,scale(test.data+rnorm(100,0,0.1))/2,1,0,0)$B_T.
),main='B_T = 0.5 \n 90% joint variation',xlab='B_T',xlim=c(0,0.6));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.