monpol: Monotone Polynomials

Description Usage Arguments Details Value Author(s) References Examples

View source: R/00MonPol.R

Description

Determine the least-squares estimates of the parameters of a monotone polynomial

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
monpol(formula, data, subset, weights, na.action,
       degree = 3, K, start,
       a = -Inf, b=Inf,
       trace = FALSE, plot.it = FALSE,
       control = monpol.control(),
       algorithm = c("Full", "Hawkins", "BCD", "CD1", "CD2"),
       ptype = c("SOS", "Elphinstone", "EHH", "Penttila"),
       ctype = c("cge0", "c2"),
       monotone,
       model=FALSE, x=FALSE, y=FALSE)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which monpol is called.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

weights

an optional vector of weights to be used in the fitting process. Should be NULL or a numeric vector.

na.action

a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The ‘factory-fresh’ default is na.omit. Another possible value is NULL, no action. Value na.exclude can be useful.

degree

positive integer, a polynomial with highest power equal to degree will be fitted to the data.

K

non-negative integer, a polynomial with highest power 2K+1 will be fitted to the data.

start

optional starting value for the iterative fitting.

a,b

polynomial should be monotone on the interval from a to b. If either parameter is finite, parameterisation “SOS” has to be used.

trace

print out information about the progress of the interative fitting at the start and then every trace iterations.

plot.it

plot the data and initial fit, then plot current fit every plot.it iterations.

control

settings that control the iterative fit; see monpol.control for details.

algorithm

algorithm to be used. It is recommended to use either “Full” or “Hawkins”; see both papers in ‘References’ for details.

ptype

parameterisation to be used. It is recommended to use the “SOS” parameterisation; see the 2016 paper in ‘References’ for details.

ctype

parameterisation to be used; see paper in ‘References’ for details.

monotone

only used for parameterisation “SOS” to enforce the kind of monotonicity desired over the interval [a,b], should be “increasing” or “decreasing”.

model, x, y

logicals. If TRUE the corresponding components of the fit (the model frame, the model matrix, the response, the QR decomposition) are returned.

Details

A monpol object is a type of fitted model object. It has methods for the generic function coef, fitted, formula, logLik, model.matrix, predict, print, residuals.

The parameterisation type “SOS” with the “Full” algorithm is currently the recommended fitting procedure and is discussed in the 2016 paper in ‘References’. For this parameterisation the argument ctype is ignored.

The “Hawkins” algorithm is also recommended and discussed in both papers in the ‘References’.

The parameterisations “Elphinstone”, “EHH” and “Pentilla”, for which the argument “ctype” defines a further variation of parameterisation, work together with algorithms “Full”, “BCD”, “CD1” and “CD2”. These parameterisations and algorithms are discussed in the 2013 paper in ‘References’.

Value

monpol returns an object of class "monpol"

Author(s)

Berwin A Turlach <[email protected]>

References

Murray, K., Müller, S. and Turlach, B.A. (2016). Fast and flexible methods for monotone polynomial fitting, Journal of Statistical Computation and Simulation 86(15): 2946–2966, doi: 10.1080/00949655.2016.1139582.

Murray, K., Müller, S. and Turlach, B.A. (2013). Revisiting fitting monotone polynomials to data, Computational Statistics 28(5): 1989–2005, doi: 10.1007/s00180-012-0390-5.

Examples

1
monpol(y~x, w0)

MonoPoly documentation built on Dec. 23, 2017, 5:40 p.m.

Related to monpol in MonoPoly...