predict.msma {msma} | R Documentation |
Prediction
Description
predict method for class "msma".
Usage
## S3 method for class 'msma'
predict(object, newX, newY = NULL, ...)
Arguments
object |
an object of class " |
newX |
a matrix in which to look for variables with which to predict X. |
newY |
a matrix in which to look for variables with which to predict Y. |
... |
further arguments passed to or from other methods. |
Details
This function produces a prediction from new data based on msma
fit. It is mainly used in cross-validation
Value
X |
predicted X |
sbX |
block score for X |
Y |
predicted Y |
sbY |
block score for Y |
Examples
##### data #####
tmpdata = simdata(n = 50, rho = 0.8, Yps = c(10, 12, 15), Xps = 20, seed=1)
X = tmpdata$X; Y = tmpdata$Y
##### Two Component #####
fit2 = msma(X, Y, comp=2, lambdaX=2, lambdaY=1:3)
summary(fit2)
##### Predict #####
test = predict(fit2, newX=X, newY=Y)
[Package msma version 3.1 Index]