cvx.lse.con.reg: Convex Least Squares Regression.

Description Usage Arguments Details Value Author(s) Source References Examples

View source: R/CvxLseConReg.r

Description

This function provides an estimate of the non-parametric regression function with a shape constraint of convexity and no smoothness constraint. Note that convexity by itself provides some implicit smoothness.

Usage

1
2
3
cvx.lse.con.reg(t, z, w = NULL,...)
## Default S3 method:
cvx.lse.con.reg(t, z, w = NULL, ...)

Arguments

t

a numeric vector giving the values of the predictor variable.

z

a numeric vector giving the values of the response variable.

w

an optional numeric vector of the same length as t; Defaults to all elements 1/n.

...

additional arguments.

Details

This function does the same thing as cvx.lse.reg except that here we use conreg function from cobs package which is faster than cvx.lse.reg. The plot, predict, print functions of cvx.lse.reg also apply for cvx.lse.con.reg.

Value

An object of class ‘cvx.lse.reg’, basically a list including the elements

x.values

sorted ‘t’ values provided as input.

y.values

corresponding ‘z’ values in input.

fit.values

corresponding fit values of same length as that of ‘x.values’.

deriv

corresponding values of the derivative of same length as that of ‘x.values’.

iter

number of steps taken to complete the iterations.

residuals

residuals obtained from the fit.

minvalue

minimum value of the objective function attained.

convergence

a numeric indicating the convergence of the code. Always set to 1.

Author(s)

Arun Kumar Kuchibhotla, arunku@wharton.upenn.edu

Source

Lawson, C. L and Hanson, R. J. (1995). Solving Least Squares Problems. SIAM.

References

Chen, D. and Plemmons, R. J. (2009). Non-negativity Constraints in Numerical Analysis. Symposium on the Birth of Numerical Analysis.

Liao, X. and Meyer, M. C. (2014). coneproj: An R package for the primal or dual cone projections with routines for constrained regression. Journal of Statistical Software 61(12), 1 – 22.

Examples

1
2
3
4
5
6
7
args(cvx.lse.con.reg)
x <- runif(50,-1,1)
y <- x^2 + rnorm(50,0,0.3)
tmp <- cvx.lse.con.reg(x, y)
print(tmp)
plot(tmp)
predict(tmp, newdata = rnorm(10,0,0.1))

Example output

Loading required package: nnls
Loading required package: cobs
function (t, z, w = NULL, ...) 
NULL
Call:
cvx.lse.con.reg.default(t = x, z = y)
Minimum Criterion Value Obtained:
[1] 0.04580799
Number of Iterations:
[1] 1
Convergence Status:
[1] 1
 [1]  0.04968594  0.02669879  0.02347317  0.01353039  0.04957110  0.02412655
 [7] -0.06010213  0.03487469  0.01709114  0.03332148

simest documentation built on May 2, 2019, 5:40 a.m.