R/posterior.mode.R

"posterior.mode"<-function(x, adjust=0.1, ...){

   if(is.mcmc(x)==FALSE){
     warning("posterior.mode expecting mcmc object")
   }

  find.mode<-function(x,adjust,...){
    dx<-density(x, adjust=adjust, ...)
    dx$x[which.max(dx$y)]
  }
  apply(as.matrix(x), 2, find.mode, adjust=adjust, ...)
}

Try the MCMCglmm package in your browser

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

MCMCglmm documentation built on July 9, 2023, 5:24 p.m.