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
References
Murray, K., M<c3><83><c2><bc>ller, S. and Turlach, B.A. (2016). Fast and
flexible methods for monotone polynomial fitting, Journal of
Statistical Computation and Simulation.
Accepted for publication, doi:10.1080/00949655.2016.1139582.
Murray, K., M<c3><83><c2><bc>ller, S. and Turlach,
B.A. (2013). Revisiting fitting monotone polynomials to data,
Computational Statistics28(5):
1989–2005. Doi:10.1007/s00180-012-0390-5.
Examples
monpol(y~x, w0)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MonoPoly)
Loading required package: quadprog
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MonoPoly/monpol.Rd_%03d_medium.png", width=480, height=480)
> ### Name: monpol
> ### Title: Monotone Polynomials
> ### Aliases: monpol
> ### Keywords: nonlinear regression models
>
> ### ** Examples
>
> monpol(y~x, w0)
Monotone polynomial model
Call:
monpol(formula = y ~ x, data = w0)
Coefficients:
beta0 beta1 beta2 beta3
-0.004059 0.015497 0.008259 0.072618
>
>
>
>
>
> dev.off()
null device
1
>