Learn R Programming

msma (version 3.1)

predict.msma: Prediction

Description

predict method for class "msma".

Usage

# S3 method for msma
predict(object, newX, newY = NULL, ...)

Value

X

predicted X

sbX

block score for X

Y

predicted Y

sbY

block score for Y

Arguments

object

an object of class "msma", usually, a result of a call to msma

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

Examples

Run this code
##### 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)

Run the code above in your browser using DataLab