Learn R Programming

isotone (version 1.1-1)

gpava: Generalized Pooled-Adjacent-Violators Algorithm (PAVA)

Description

Pooled-adjacent-violators algorithm for general isotone regression problems. It allows for general convex target function, multiple measurements, and different approaches for handling ties.

Usage

gpava(z, y, weights = NULL, solver = weighted.mean, ties = "primary", p = NA)

Value

Generates an object of class gpava.

x

Fitted values

y

Observed response

z

Observed predictors

w

Weights

solver

Convex function

call

Matched call

p

Fractile value

Arguments

z

Vector of abscissae values

y

Vector or list of vectors of responses

weights

Vector of list of vectors of observation weights

solver

Either weighted.mean, weighted.median, weighted.fractile, or a user-specified function (see below)

ties

Treatment of ties, either "primary", "secondary", or "tertiary"

p

Fractile value between 0 and 1 if weighted.fractile is used

Author

Kurt Hornik, Jan de Leeuw, Patrick Mair

Details

A Pool Adjacent Violators Algorithm framework for minimizing problems like

$$\sum_i \sum_{J_i} w_{ij} f(y_{ij}, m_i)$$

under the constraint \(m_1 \le ... \le m_n\) with \(f\) a convex function in m. Note that this formulation allows for repeated data in each block (i.e. each list element of y, and hence is more general than the usual pava/isoreg ones.

A solver for the unconstrained \(\sum_k w_k f(y_k, m) -> min!\) can be specified. Typical cases are \(f(y, m) = |y - m|^p\) for \(p = 2\) (solved by weighted mean) and \(p = 1\) (solved by weighted median), respectively.

Using the weighted.fractile solver corresponds to the classical minimization procedure in quantile regression.

The user can also specify his own function foo(y, w) with responses and weights as arguments. It should return a single numerical value.

References

de Leeuw, J., Hornik, K., Mair, P. (2009). Isotone Optimization in R: Pool-Adjacent-Violators Algorithm (PAVA) and Active Set Methods. Journal of Statistical Software, 32(5), 1-24.

Examples

Run this code

data(pituitary)
##different tie approaches
gpava(pituitary[,1],pituitary[,2], ties = "primary")
gpava(pituitary[,1],pituitary[,2], ties = "secondary")
gpava(pituitary[,1],pituitary[,2], ties = "tertiary")

##different target functions
gpava(pituitary[,1],pituitary[,2], solver = weighted.mean)
gpava(pituitary[,1],pituitary[,2], solver = weighted.median)
gpava(pituitary[,1],pituitary[,2], solver = weighted.fractile, p = 0.25)


##repeated measures
data(posturo)
res <- gpava(posturo[,1],posturo[,2:4], ties = "secondary")
plot(res)

Run the code above in your browser using DataLab