getPosteriorMode: Function to get mode from a posterior distribution

Description Usage Arguments Value Examples

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

1

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

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

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

Example output

This is tRophicPosition 0.7.0
 First Second 
 0.775  1.654 
[1] 5.03

tRophicPosition documentation built on May 2, 2019, 4:15 a.m.