simcontour: Simulated draws from a bivariate density function on a grid

Description Usage Arguments Value Author(s) Examples

Description

For a general two parameter density defined on a grid, simulates a random sample.

Usage

1
simcontour(logf,limits,data,m)

Arguments

logf

function that defines the logarithm of the density

limits

limits (xlo, xhi, ylo, yhi) that cover the joint probability density

data

vector or list of parameters associated with the function logpost

m

size of simulated sample

Value

x

vector of simulated draws of the first parameter

y

vector of simulated draws of the second parameter

Author(s)

Jim Albert

Examples

1
2
3
4
5
m=array(c(0,0),c(2,1))
v=array(c(1,.6,.6,1),c(2,2))
normpar=list(m=m,v=v)
s=simcontour(lbinorm,c(-4,4,-4,4),normpar,1000)
plot(s$x,s$y)

Example output



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