pava {SAGx} | R Documentation |
The PAVA algorithm
pava(x, wt = rep(1, length(x)))
x |
A numeric sequence |
wt |
observation weights; 1 by default. |
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
A non-decreasing sequence
R.F. Raubertas, code from S list
pava(c(1,2,4,3,5)) # [1] 1.0 2.0 3.5 3.5 5.0