laplace: Summarization of a posterior density by the Laplace method

Description Usage Arguments Value Author(s) Examples

Description

For a general posterior density, computes the posterior mode, the associated variance-covariance matrix, and an estimate at the logarithm at the normalizing constant.

Usage

1
laplace(logpost,mode,...)

Arguments

logpost

function that defines the logarithm of the posterior density

mode

vector that is a guess at the posterior mode

...

vector or list of parameters associated with the function logpost

Value

mode

current estimate at the posterior mode

var

current estimate at the associated variance-covariance matrix

int

estimate at the logarithm of the normalizing constant

converge

indication (TRUE or FALSE) if the algorithm converged

Author(s)

Jim Albert

Examples

1
2
3
4
5
6
7
8
logpost=function(theta,data)
{
s=5
sum(-log(1+(data-theta)^2/s^2))
}
data=c(10,12,14,13,12,15)
start=10
laplace(logpost,start,data)

Example output

$mode
[1] 12.68945

$var
         [,1]
[1,] 2.685352

$int
[1] 0.8572137

$converge
[1] TRUE

LearnBayes documentation built on May 1, 2019, 7:03 p.m.