Description Usage Arguments Details Value Author(s) See Also Examples
The cross-validation is based on a fitted lpls object of type exo or endo (not exo_ort).
The predictive ability of the model is measured in terms of root mean sums of squares of prediction (RMSEP)
over the set of components from 1 to npc as defined in the call to the lpls-object.
Cross-validation is only implmented across segments defined as rows of X1 and X2 (horizontal prediction)
or across columns of X2 (rows of X3) (vertical prediction). Cross-validation requires that all missing values have
been imputed in the model fit, that is, option impute=TRUE must be used in the call to lpls.
| 1 | 
| fit | A fitted lpls object of type endo or exo. | 
| segments1 | A list of cross-validation segments for horizontal prediction. For leave-one-out-CV across  | 
| segments2 | A list of cross-validation segments for vertical prediction. For leave-one-out-CV across  | 
| trace | Logical. If  | 
If no segment list is supplied a horizontal leave-one-out CV is performed across the components 1:npc.
| rmsep | The  | 
| pred | An array of predicted values. The last dimension of pred is the number of components used in the prediction. | 
Solve S?b?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |     simdata <- lpls.sim()
    X1 <- simdata$X1
    X2 <- simdata$X2
    X3 <- simdata$X3
    #To run endo-LPSL:
    fit.endo <- lpls(X1,X2,t(X3), npc=2, type="endo")
    
    #To cross-validate horizontally
    cv <- lplsCV(fit.endo, segments1=as.list(1:dim(X1)[1]))
    #To cross-validate vertically
    cv <- lplsCV(fit.endo, segments2=as.list(1:dim(X2)[2]))
    #Three-fold CV, horizontal
    segmat <- matrix(1:30, nrow=3, byrow=TRUE)
    segs <- list()
    for(i in 1:3){segs[[i]] <- segmat[i,]}
    cv <- lplsCV(fit.endo, segments1=segs)
    
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.