Learn R Programming

MonoPoly (version 0.2-10)

monpol.fit: Monotone Polynomials

Description

This is the basic computing engine called by monpol used to fit monotonic polynomials. These should usually not be used directly unless by experienced users.

Usage

monpol.fit(x, y, w, K=1, start, trace = FALSE, plot.it = FALSE,
           control = monpol.control(),
           algorithm = c("Full", "Hawkins", "BCD", "CD1", "CD2"),
           ptype = c("Elphinstone", "EHH", "Penttila"),
           ctype = c("cge0", "c2"))

Arguments

x
vector containing the observed values for the regressor variable.
y
vector containing the observed values for the response variable; should be of same length as x.
w
optional vector of weights; should be of the same length as x if specified.
K
a polynomial with highest power $2K+1$ will be fitted to the data.
start
optional starting value for the iterative fitting.
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; see monpol for details.
ptype
parameterisation to be used; see monpol for details.
ctype
parameterisation to be used; see monpol for details.

Value

  • a list with components
  • parthe fitted parameters.
  • gradthe gradient of the objective function at the fitted parameters.
  • betathe coefficients of the fitted polynomial in the beta parameterisation; on the fitted scale.
  • RSSthe value of the objective function; on the fitted scale.
  • niternumber of iterations.
  • convergedindicates whether algorithm has converged.
  • ptypeinput parameter ptype.
  • ctypeinput parameter cptype.
  • beta.rawthe coefficients of the fitted polynomial in the beta parameterisation; on the original scale.
  • fitted.valuesthe fitted values; on the fitted scale.
  • residualsthe residuals; on the fitted scale.
  • Kinput parameter K.
  • minxthe minimum value in the vector x.
  • sclxthe difference between the maximum and minimum values in the vector x.
  • minythe minimum value in the vector y.
  • sclythe difference between the maximum and minimum values in the vector y.
  • algorithminput paramater algorithm.

References

Murray, K., Müller{Mueller}, 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.

See Also

monpol which you should use for fitting monotonic polynomials unless you know better.