predict.JIVEpred | R Documentation |
Predicted values based on the an JIVE-predict model.
## S3 method for class 'JIVEpred' predict(object, newdata, ...)
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. |
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.
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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.