R/modes.R

modes <-
function (y) {
    test <- try(d <- density(y, bw = "nrd", adjust = 3, n = 1000), silent = TRUE)
    if (!inherits(test, "try-error")) d$x[which.max(d$y)] else NA
}

Try the JMbayes package in your browser

Any scripts or data that you put into this service are public.

JMbayes documentation built on Jan. 9, 2020, 9:07 a.m.