| Positively constrained least squares | R Documentation |
Positively constrained least squares.
pls(y, x)
mpls(y, x)
y |
The response variable. For the pls() a numerical vector with observations, but for the mpls() a numerical matrix . |
x |
A matrix with independent variables, the design matrix. |
The constraint is that all beta coefficients (including the constant) are non negative, i.e.
min \sum_{i=1}^n(y_i-\bm{x}_i^\top\bm{\beta})^2 such that \beta_j \geq 0. The pls() function performs a single regression model, whereas the mpls() function performs a regression for each column of y. Each regression is independent of the others.
A list including:
be |
A numerical matrix with the positively constrained beta coefficients. |
mse |
A numerical vector with the mean squared error(s). |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
cls, pcls, mvpls
x <- as.matrix( iris[1:50, 1:4] )
y <- rnorm(50)
pls(y, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.