getPosteriorMode: Function to get mode from a posterior distribution

View source: R/getPosteriorMode.R

getPosteriorModeR Documentation

Function to get mode from a posterior distribution

Description

This function is a wrapper of hdr, it returns one mode (if receives a vector), otherwise it returns a list of modes (if receives a list of vectors). If receives an mcmc object it returns the marginal parameter mode using Kernel density estimation (posterior.mode).

Usage

getPosteriorMode(df = NULL, round = 3)

Arguments

df

data frame, list or vector with posterior distribution(s).

round

numeric, number of decimals rounded.

Value

a vector or a list of modes

Examples

# List example
a <- list("First" = rnorm(100,1), "Second" = rnorm(100,2))
getPosteriorMode(a)

# vector example
getPosteriorMode(rnorm(100,5), round = 2)

tRophicPosition documentation built on Dec. 28, 2022, 2:27 a.m.