Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sir

Sampling importance resampling


Description

Implements sampling importance resampling for a multivariate t proposal density.

Usage

sir(logf,tpar,n,data)

Arguments

logf

function defining logarithm of density of interest

tpar

list of parameters of multivariate t proposal density including the mean m, the scale matrix var, and the degrees of freedom df

n

number of simulated draws from the posterior

data

data and parameters used in the function logf

Value

matrix of simulated draws from the posterior where each row corresponds to a single draw

Author(s)

Jim Albert

Examples

data(cancermortality)
start=c(-7,6)
fit=laplace(betabinexch,start,cancermortality)
tpar=list(m=fit$mode,var=2*fit$var,df=4)
theta=sir(betabinexch,tpar,1000,cancermortality)

LearnBayes

Functions for Learning Bayesian Inference

v2.15.1
GPL (>= 2)
Authors
Jim Albert
Initial release
2018-03-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.