This function computes the Partial Least Squares fit.

pls.model(
X,
y,
m = ncol(X),
Xtest = NULL,
ytest = NULL,
compute.DoF = FALSE,
compute.jacobian = FALSE,
use.kernel = FALSE,
method.cor = "pearson"
)

## Arguments

X |
matrix of predictor observations. |

y |
vector of response observations. The length of `y` is the same
as the number of rows of `X` . |

m |
maximal number of Partial Least Squares components. Default is
`m=min(ncol(X),nrow(X)-1)` . |

Xtest |
optional matrix of test observations. Default is
`Xtest=NULL` . |

ytest |
optional vector of test observations. Default is
`ytest=NULL` . |

compute.DoF |
Logical variable. If `compute.DoF=TRUE` , the Degrees
of Freedom of Partial Least Squares are computed. Default is
`compute.DoF=FALSE` . |

compute.jacobian |
Should the first derivative of the regression
coefficients be computed as well? Default is `FALSE` |

use.kernel |
Should the kernel representation be used to compute the
solution. Default is `FALSE` . |

method.cor |
How should the correlation to the response be computed?
Default is ''pearson''. |

## Value

coefficientsmatrix of regression coefficients

interceptvector of intercepts

DoFvector of Degrees of
Freedom

RSSvector of residual sum of error

sigmahatvector
of estimated model error

Yhatmatrix of fitted values

yhatvector of squared length of fitted values

covarianceif
`compute.jacobian`

is `TRUE`

, the function returns the array of
covariance matrices for the PLS regression coefficients.

predictionif Xtest is provided, the predicted y-values for
Xtest. mseif Xtest and ytest are provided, the
mean squared error on the test data. corif Xtest and
ytest are provided, the correlation to the response on the test data.

## Details

This function computes the Partial Least Squares fit and its Degrees of
Freedom. Further, it returns the regression coefficients and various
quantities that are needed for model selection in combination with
`information.criteria`

.

## References

Kraemer, N., Sugiyama M. (2011). "The Degrees of Freedom of
Partial Least Squares Regression". Journal of the American Statistical
Association 106 (494)
https://www.tandfonline.com/doi/abs/10.1198/jasa.2011.tm10107

Kraemer, N., Sugiyama, M., Braun, M.L. (2009) "Lanczos Approximations for
the Speedup of Partial Least Squares Regression", Proceedings of the 12th
International Conference on Artificial Intelligence and Stastistics, 272 -
279

## See also

## Author

Nicole Kraemer, Mikio L. Braun

## Examples