pava {Iso} | R Documentation |
The ``pool adjacent violators algorithm'' (PAVA) is applied to calculate the isotonic regression of a set of data, with respect to the usual increasing linear ordering on the indices.
pava(y, w, long.out=FALSE) pava.sa(y, w, long.out=FALSE)
y |
Vector of data whose isotonic regression is to be calculated. |
w |
Optional vector of weights to be used for calculating a weighted isotonic regression; if w is not given, all weights are taken to equal 1. |
long.out |
Logical argument controlling the nature of the value returned. |
The function pava()
uses dynamically loading of a fortran
subroutine "pava" to effect the computations. The function pava.sa()
("sa" for "stand-alone") does all of the computations in raw R. Thus
pava.sa()
could be considerably slower for large data sets.
If long.out = TRUE then the result returned consists of a list whose components are
y |
the fitted values |
w |
the final weights |
tr |
a set of indices made up of the smallest index in each level set, which thus "keeps track" of the level sets. |
If long.out = FALSE then only the vector of fitted values is returned.
Rolf Turner r.turner@auckland.ac.nz http://www.math.unb.ca
Robertson, T., Wright, F. T. and Dykstra, R. L. (1988). Order Restricted Statistical Inference. Wiley, New York.
ufit()
y <- (1:20) + rnorm(20) ystar <- pava(y) plot(y) lines(ystar,type='s')