| Title: | Constrained Quantile Regression |
|---|---|
| Description: | Constrained quantile regression is performed. One constraint is that all beta coefficients (including the constant) cannot be negative, they can be either 0 or strictly positive. Another constraint is that the beta coefficients lie within an interval. References: Koenker R. (2005) Quantile Regression, Cambridge University Press. <doi:10.1017/CBO9780511754098>. |
| Authors: | Michail Tsagris [aut, cre] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0 |
| Built: | 2026-05-27 09:13:53 UTC |
| Source: | https://github.com/cran/consrq |
Constrained quantile regression is performed. One constraint is that all beta coefficients (including the constant) cannot be negative. They can be either 0 or strictly positive. Another constraint is that the beta coefficients lie within an interval.
| Package: | consrq |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2024-11-20 |
Michail Tsagris <[email protected]>.
Michail Tsagris [email protected]
Koenker R. (2005) Quantile Regression, Cambridge University Press.
Lower and upper bound constrained quantile regression.
int.crq(y, x, tau = 0.5, lb, ub) int.mcrq(y, x, tau = 0.5, lb, ub)int.crq(y, x, tau = 0.5, lb, ub) int.mcrq(y, x, tau = 0.5, lb, ub)
y |
For the int.crq() the response variable, a numerical vector with observations, but a matrix of response variables for the int.mcrq(). |
x |
A matrix with independent variables, the design matrix. |
tau |
The quantile(s) to be estimated, a number strictly between 0 and 1. It a vector of values between 0 and 1; in this case an object of class "rqs" is returned containing among other things a matrix of coefficient estimates at the specified quantiles. |
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 quantile regression under the constraint that the beta coefficients lie within interval(s), i.e. such that .
A list including:
be |
A numerical matrix with the constrained beta coefficients. |
mae |
A numerical vector with the mean absolute error(s). |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
x <- as.matrix( iris[1:50, 1:4] ) y <- rnorm(50) int.crq(y, x, lb = -0.2, ub = 0.2)x <- as.matrix( iris[1:50, 1:4] ) y <- rnorm(50) int.crq(y, x, lb = -0.2, ub = 0.2)
Positive and unit sum constrained quantile regression.
pcrq(y, x, tau = 0.5) mpcrq(y, x, tau = 0.5)pcrq(y, x, tau = 0.5) mpcrq(y, x, tau = 0.5)
y |
The response variable. For the pcrq() a numerical vector with observations, but for the mpcrq() a numerical matrix. |
x |
A matrix with independent variables, the design matrix. |
tau |
The quantile(s) to be estimated, a number strictly between 0 and 1. It a vector of values between 0 and 1; in this case an object of class "rqs" is returned containing among other things a matrix of coefficient estimates at the specified quantiles. |
The constraint is that all beta coefficients are positive and sum to 1. That is,
i.e. such that and . The pcrq() function performs a single regression model, whereas the mpcrq() 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. |
mae |
A numerical vector with the mean absolute error. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
x <- as.matrix( iris[1:50, 1:4] ) y <- rnorm(50) pcrq(y, x)x <- as.matrix( iris[1:50, 1:4] ) y <- rnorm(50) pcrq(y, x)
Positively constrained quantile regression.
prq(y, x, tau = 0.5) mprq(y, x, tau = 0.5)prq(y, x, tau = 0.5) mprq(y, x, tau = 0.5)
y |
The response variable. For the prq() a numerical vector with observations, but for the mprq() a numerical matrix . |
x |
A matrix with independent variables, the design matrix. |
tau |
The quantile(s) to be estimated, a number strictly between 0 and 1. It a vector of values between 0 and 1; in this case an object of class "rqs" is returned containing among other things a matrix of coefficient estimates at the specified quantiles. |
The constraint is that all beta coefficients (including the constant) are non negative. That is,
such that .
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. |
mae |
A numerical vector with the mean absolute error(s). |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
x <- as.matrix( iris[1:50, 1:4] ) y <- rnorm(50) prq(y, x)x <- as.matrix( iris[1:50, 1:4] ) y <- rnorm(50) prq(y, x)