cvxreg: Estimation of an increasing and convex function

View source: R/main.R

cvxregR Documentation

Estimation of an increasing and convex function

Description

This function computes the least squares increasing and convex regression estimator by a sequential mixed primal-dual bases algorithm.

Usage

cvxreg(x,y)

Arguments

x

a numeric vector that contains all the design points. NB. for the current version, we require all values to be distinct (but not necessarily in ascending order).

y

a numeric vector that contains the values of the response with respect to the design points.

Details

For more details, see Sshaped.

Value

An object of class sshaped, which contains the following fields:

x

covariates copied from input

y

response copied from input

fitted

the fitted values of the regression function with respect to the design points.

rss

the value of the minimised residual sum of squares of the fit

inflection

the location of the inflection point, which equals max(x) here

shape

the shape enforced in the fit, here equals "convex"

Author(s)

Examples

x<-seq(0,5,0.01)
y<-x^2 + rnorm(length(x))
output<-cvxreg(x,y)
plot(output)
xnew=rexp(5); predict(output,xnew)

Sshaped documentation built on Oct. 13, 2022, 5:05 p.m.