| isotonic_regression | R Documentation |
Computes isotonic mean regression for numeric responses. When covariates are supplied they determine the ordering; when omitted the responses are assumed pre-sorted (regression on the index). When weights are omitted every observation receives weight 1.
isotonic_regression(y, X = NULL, weights = NULL, decreasing = FALSE)
y |
numeric vector of response values. |
X |
numeric vector of covariate values, or |
weights |
numeric vector of finite, non-negative weights, at least one
of which must be positive, or |
decreasing |
whether the fit is decreasing in the covariate (default
|
Numeric vector of isotonic fitted means, one per observation.
isotonic_regression(c(2, 3, 1, 4, 5), X = 1:5)
isotonic_regression(c(3, 2, 4, 1), X = 1:4, weights = c(1, 2, 1, 1))
isotonic_regression(sort(c(3, 1, 2, 5)))
isotonic_regression(sort(c(2, 1, 3)), weights = c(1, 2, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.