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 Nov. 5, 2025, 6:52 p.m.