Determine the least-squares estimates of the parameters of a monotone polynomial
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)an object of class "formula" (or one that
can be coerced to that class): a symbolic description of the
model to be fitted.
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.
an optional vector specifying a subset of observations to be used in the fitting process.
an optional vector of weights to be used in the fitting
process. Should be NULL or a numeric vector.
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.
positive integer, a polynomial with highest power equal
to degree will be fitted to the data.
non-negative integer, a polynomial with highest power \(2K+1\) will be fitted to the data.
optional starting value for the iterative fitting.
polynomial should be monotone on the interval from a to b. If either parameter is finite, parameterisation “SOS” has to be used.
print out information about the progress of the
interative fitting at the start and then every trace
iterations.
plot the data and initial fit, then plot current fit
every plot.it iterations.
settings that control the iterative fit; see
monpol.control for details.
algorithm to be used. It is recommended to use either “Full” or “Hawkins”; see both papers in ‘References’ for details.
parameterisation to be used. It is recommended to use the “SOS” parameterisation; see the 2016 paper in ‘References’ for details.
parameterisation to be used; see paper in ‘References’ for details.
only used for parameterisation “SOS” to enforce the kind of monotonicity desired over the interval \([a,b]\), should be “increasing” or “decreasing”.
logicals. If TRUE the corresponding
components of the fit (the model frame, the model matrix, the
response, the QR decomposition) are returned.
monpol returns an object of class "monpol"
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’.
Murray, K., M<U+00FC>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, 10.1080/00949655.2016.1139582.
Murray, K., M<U+00FC>ller, S. and Turlach, B.A. (2013). Revisiting fitting monotone polynomials to data, Computational Statistics 28(5): 1989--2005, 10.1007/s00180-012-0390-5.
# NOT RUN {
monpol(y~x, w0)
# }
Run the code above in your browser using DataLab