powered by
For a general two parameter density defined on a grid, simulates a random sample.
simcontour(logf,limits,data,m)
function that defines the logarithm of the density
limits (xlo, xhi, ylo, yhi) that cover the joint probability density
vector or list of parameters associated with the function logpost
size of simulated sample
vector of simulated draws of the first parameter
vector of simulated draws of the second parameter
# NOT RUN { 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) # }
Run the code above in your browser using DataLab