isoMean {logcondens} | R Documentation |
Pool-Adjacent Violaters Algorithm: Least Square Fit under Monotonicity Constraint
Description
Fits a vector with nondecreasing components to the data vector
such that
is minimal (pool - adjacent - violators algorithm). In case a weight vector with positive entries (and the same size as ) is provided, the function produces an isotonic vector minimizing
Usage
isoMean(y, w)
Arguments
y |
Vector |
w |
Arbitrary vector |
Value
Returns vector .
Author(s)
Kaspar Rufibach, kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
Lutz Duembgen, duembgen@stat.unibe.ch,
https://www.imsv.unibe.ch/about_us/staff/prof_dr_duembgen_lutz/index_eng.html
Examples
## simple regression model
n <- 50
x <- sort(runif(n, 0, 1))
y <- x ^ 2 + rnorm(n, 0, 0.2)
s <- seq(0, 1, by = 0.01)
plot(s, s ^ 2, col = 2, type = 'l', xlim = range(c(0, 1, x)),
ylim = range(c(0, 1 , y))); rug(x)
## plot pava result
lines(x, isoMean(y, rep(1 / n, n)), type = 's')
[Package logcondens version 2.1.8 Index]