Description Usage Arguments Value Author(s) Examples

View source: R/rejectsampling.R

Implements a rejection sampling algorithm for a probability density using a multivariate t proposal density

1 | ```
rejectsampling(logf,tpar,dmax,n,data)
``` |

`logf` |
function that defines the logarithm of the density of interest |

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

`dmax` |
logarithm of the rejection sampling constant |

`n` |
number of simulated draws from proposal density |

`data` |
data and or parameters used in the function logf |

matrix of simulated draws from density of interest

Jim Albert

1 2 3 4 5 | ```
data(cancermortality)
start=c(-7,6)
fit=laplace(betabinexch,start,cancermortality)
tpar=list(m=fit$mode,var=2*fit$var,df=4)
theta=rejectsampling(betabinexch,tpar,-569.2813,1000,cancermortality)
``` |

LearnBayes documentation built on May 20, 2017, 2:24 a.m.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.