mono.con: Monotonicity constraints for a cubic regression spline

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Finds linear constraints sufficient for monotonicity (and optionally upper and/or lower boundedness) of a cubic regression spline. The basis representation assumed is that given by the gam, "cr" basis: that is the spline has a set of knots, which have fixed x values, but the y values of which constitute the parameters of the spline.

Usage

1
mono.con(x,up=TRUE,lower=NA,upper=NA)

Arguments

x

The array of knot locations.

up

If TRUE then the constraints imply increase, if FALSE then decrease.

lower

This specifies the lower bound on the spline unless it is NA in which case no lower bound is imposed.

upper

This specifies the upper bound on the spline unless it is NA in which case no upper bound is imposed.

Details

Consider the natural cubic spline passing through the points (x_i,p_i), i=1..n. Then it is possible to find a relatively small set of linear constraints on p sufficient to ensure monotonicity (and bounds if required): Ap >= b. Details are given in Wood (1994).

Value

a list containing constraint matrix A and constraint vector b.

Author(s)

Simon N. Wood simon.wood@r-project.org

References

Gill, P.E., Murray, W. and Wright, M.H. (1981) Practical Optimization. Academic Press, London.

Wood, S.N. (1994) Monotonic smoothing splines fitted by cross validation. SIAM Journal on Scientific Computing 15(5), 1126–1133.

http://www.maths.bris.ac.uk/~sw15190/

See Also

magic, pcls

Examples

1
## see ?pcls


Search within the mgcv package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.