pava {Iso}R Documentation

Calculate the linear increasing order isotonic regression of a set of data.

Description

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.

Usage

pava(y, w, long.out=FALSE)
pava.sa(y, w, long.out=FALSE)

Arguments

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.

Details

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.

Value

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.

Author(s)

Rolf Turner r.turner@auckland.ac.nz http://www.math.unb.ca

References

Robertson, T., Wright, F. T. and Dykstra, R. L. (1988). Order Restricted Statistical Inference. Wiley, New York.

See Also

ufit()

Examples

y <- (1:20) + rnorm(20)
ystar <- pava(y)
plot(y)
lines(ystar,type='s')

[Package Iso version 0.0-4 Index]