predict.JIVEpred: Prediction for JIVE-predict

View source: R/JIVE.pred.R

predict.JIVEpredR Documentation

Prediction for JIVE-predict

Description

Predicted values based on the an JIVE-predict model.

Usage

## S3 method for class 'JIVEpred'
predict(object, newdata, ...)

Arguments

object

An object of class "JIVEpred", usually a fitted JIVE-predict model.

newdata

A list of matrices representing the new X datasets.

...

further arguments passed to or from other methods.

Details

predict.JIVEpred calculates predicted values for newdata based on the fitted model. The function first calculates the joint and individual score matrices for newdata treating the loading matrices from the initial JIVE model as fixed. Once the new score matrices are obtained, the GLM prediction will be evaluated using the new scores as the data matrix.

Value

A list of the following components is returned:

Ypred

The fitted Y values.

Ynat

The fitted values of Y's natural parameter space.

joint.scores

A matrix capturing the the joint scores of newdata.

indiv.scores

A list containing matrices that capture the individual scores of newdata.

error

The error value at which the model converged.

Examples

train.x <- list(matrix(rnorm(300), ncol=20), matrix(rnorm(200), ncol=20))
train.y <- rnorm(20)
test.x <- list(matrix(rnorm(600), ncol=40),matrix(rnorm(400), ncol=40))
train.fit <- JIVE.pred(X=train.x,Y=train.y,rankJ=1,rankA=c(1,1))
test.fit <- predict(train.fit, test.x)

enorthrop/sup.r.jive documentation built on Nov. 18, 2022, 6:01 p.m.