Nothing
context("Isotonic regression")
testthat::test_that("Pooled Adjacent Violator Algorithm", {
onerun <- function() {
n <- 10
x <- runif(n,-4,4)
y <- rbinom(n,1,lava::expit(-1+x))
ord <- order(x)
pv <- targeted::pava(y[ord])
xx <- x[ord[pv$index]]
yy <- pv$value
af <- stepfun(c(xx), c(yy,max(yy)), f=0, right=TRUE)
af2 <- as.stepfun(stats::isoreg(x,y))
plot(af); lines(af2, col=lava::Col("red",0.2),lwd=5)
testthat::expect_true(sum((af(x)-af2(x))^2)<1e-12)
}
replicate(10,onerun())
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.