Lower and upper bound constrained least squares | R Documentation |
Lower and upper bound constrained least squares
int.cls(y, x, lb, ub)
int.mcls(y, x, lb, ub)
y |
The response variable. For the int.cls() a numerical vector with observations, but for the int.mcls() a numerical matrix . |
x |
A matrix with independent variables, the design matrix. |
lb |
A vector or a single value with the lower bound(s) in the coefficients. |
ub |
A vector or a single value with the upper bound(s) in the coefficients. |
This function performs least squares under the constraint that the beta coefficients lie within interval(s), i.e. min \sum_{i=1}^n(y_i-\bm{x}_i^\top\bm{\beta})^2
such that lb_j\leq \beta_j \leq ub_j
.
A list including:
be |
A numerical matrix with the constrained beta coefficients. |
mse |
A numerical vector with the mean squared error. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
pls
x <- as.matrix( iris[1:50, 1:4] )
y <- rnorm(50)
int.cls(y, x, -0.2, 0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.