| predict.sJIVE | R Documentation |
Predicted values based on the an sJIVE model.
## S3 method for class 'sJIVE' predict(object, newdata, threshold = 0.001, max.iter = 2000, ...)
object |
An object of class "sJIVE", usually a fitted sJIVE model. |
newdata |
A list of matrices representing the new X datasets. |
threshold |
The threshold used to determine convergence of the algorithm. |
max.iter |
The maximum number of iterations for each instance of the sJIVE algorithm. |
... |
further arguments passed to or from other methods. |
predict.sJIVE calculates predicted values for newdata
based on the fitted model. The function first calculates the joint and
individual score matrices for newdata. Note that the fitted model's
loadings and coefficients are treated as known and will not get re-calculated.
Once the new score matrices are obtained, the linear prediction model will be
evaluated using the new scores as the data matrix.
A list of the following components is returned:
Ypred |
The fitted Y values. |
S_J |
A matrix capturing the joint scores of newdata. |
S_I |
A list containing matrices that capture the individual scores of newdata. |
iterations |
The number of iterations needed to reach convergence. |
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 <- sJIVE(X=train.x,Y=train.y,rankJ=1,rankA=c(1,1),eta=0.5) test.fit <- predict(train.fit, newdata = test.x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.