predict.msma: Prediction

View source: R/src.r

predict.msmaR 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 "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

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)


msma documentation built on Aug. 25, 2023, 9:07 a.m.