pava {SAGx}R Documentation

Pooling of Adjacent Violators

Description

The PAVA algorithm

Usage

pava(x, wt = rep(1, length(x)))

Arguments

x A numeric sequence
wt observation weights; 1 by default.

Details

The algorithm will turn a non-increasing into a non-decreasing one. pava is an internal function used to force monotonicity, e.g. of p1 in function Zfreq

Value

A non-decreasing sequence

Author(s)

R.F. Raubertas, code from S list

Examples

pava(c(1,2,4,3,5))
# [1] 1.0 2.0 3.5 3.5 5.0

[Package SAGx version 1.16.0 Index]