Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

isoMean

Pool-Adjacent Violaters Algorithm: Least Square Fit under Monotonicity Constraint


Description

Fits a vector \hat g with nondecreasing components to the data vector y such that

∑_{i=1}^n (y_i - \hat g_i)^2

is minimal (pool - adjacent - violators algorithm). In case a weight vector with positive entries (and the same size as y) is provided, the function produces an isotonic vector minimizing

∑_{i=1}^n w_i(y_i - \hat g_i)^2.

Usage

isoMean(y, w)

Arguments

y

Vector (y_1, …, y_n) of data points.

w

Arbitrary vector (w_1, …, w_n) of weights.

Value

Returns vector \widehat g.

Author(s)

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')

logcondens

Estimate a Log-Concave Probability Density from Iid Observations

v2.1.5
GPL (>= 2)
Authors
Kaspar Rufibach <kaspar.rufibach@gmail.com> and Lutz Duembgen <duembgen@stat.unibe.ch>
Initial release
2016-07-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.