Description Usage Arguments Details Value Author(s) Examples
Uses a fitted lpls-model for predictions. If the model is an endo-lpls model, the prediction is inadvert towards X2. Otherwise, in case of exo-lpls, the prediction is extrovert in the direction (X1 or X2) as specified by the user.
1 | predict.lpls(obj, X1new = NULL, X2new = NULL, X3new = NULL, exo.direction = c("X1", "X3"))
|
obj |
A fitted model object of class “lpls”. This could be either an endo- or an exo-lpls model object. |
X1new |
New predictor values for X1 in case of endo-lpls. Also a new (or old) X3 must be specified. |
X2new |
New predictor values for X2 in case of exo-lpls. X2 must have the same number of columns as X2 used in model fit in case of prediction of X1, and the same number of rows as X2 in case of X3 prediction. |
X3new |
New predictor values for X3 in case of endo-lpls. Also a new (or old) X1 must be specified. |
exo.direction |
Applicable for exo-lpls prediction. If X1 is to be predicted then |
If the corner matrix X2 has been double centered in the endo-LPLS-model fit, then the predictions may have a bias since the row- and/or column means of the new observations are not known. In such cases it may be a better option to use grand-mean centering of X2 only.
A list object pred
with element
pred |
A vector or a matrix of predicted values |
Solve S<c3><a6>b<c3><b8>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#Simulating data
simdata <- lpls.sim()
X1 <- simdata$X1
X2 <- simdata$X2
X3 <- simdata$X3
#To run exo-LPLS with non-orthogonal scores:
fit.exo <- lpls(X1,X2,t(X3), npc=2, type="exo")
#Predict X1
predict(fit.exo, X2new=X2, exo.direction="X1")
#Predict X3
predict(fit.exo, X2new=X2, exo.direction="X3")
#To run endo-LPSL:
fit.endo <- lpls(X1,X2,t(X3), npc=2, type="endo")
#Predict X2 from X1 and X3 (in this case fitted values):
predict(fit.endo,X1new=X1,X3new=t(X3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.