monotone | R Documentation |
monotone
performs simple linear ordered monotone or isotonic regression.
The function follows the up-and-down-blocks implementation (Kruskal, 1964)
of the pool-adjacent-violators algorithm (Ayer, Brunk, Ewing, Reid, and Silverman, 1955)
with additional lookaheads (Busing, 2022).
monotone(x, w = rep(1, length(x)))
x |
a real-valued vector. |
w |
a real-valued vector with positive weights (default a vector with ones). |
Error checking on x
or w
is not present.
Returns a real-valued vector with values of x
in increasing order.
Ayer M., H.D. Brunk, G.M. Ewing, W.T. Reid, and E. Silverman (1955). An empirical distribution function for sampling with incomplete information. The Annals of Mathematical Statistics, pp. 641-647. URL https://www.jstor.org/stable/pdf/2236377.pdf.
Busing, F.M.T.A. (2022). Monotone Regression: A Simple and Fast O(n) PAVA Implementation. Journal of Statistical Software, Code Snippets, 102 (1), pp. 1-25. (<doi:10.18637/jss.v102.c01>)
Kruskal, J.B. (1964). Nonmetric multidimensional scaling: a numerical method. Psychometrika, 29(2), pp. 115-129. URL http://cda.psych.uiuc.edu/psychometrika_highly_cited_articles/kruskal_1964b.pdf.
y <- c( 8, 4, 8, 2, 2, 0, 8 ) x <- monotone( y ) print( x )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.