Description Usage Arguments Details Value References Examples
Generates a single Markov Chain Monte Carlo (MCMC) chain of Gamma distribution parameter samples, using the Metropolis-Hastings algorithm.
1 2 |
counts |
A one-row data frame comprising integer counts, with column names in capital letters. Formatting requirements detailed in |
class.ages |
An optional one-row data frame specifying the starting age of each age-class. Age-classes as column names. |
N |
An optional integer specifying how many samples in the chain. |
burn |
An optional integer specifying how many initial samples in the chain should be discarded for burn-in. |
thin |
An optional integer specifying the proportion of samples to discard. I.e. 5 = every 5th sample in the chain is retained. |
prop |
An optional numerical value controlling the average jump size in the proposal function. |
plot.chain |
An optional logical value indicating if the chain should be plotted after completion. |
Prints progress every 1000th sample, and the final acceptance rate. For an efficient chain this should be around 0.3 to 0.6. If the rate is too low, efficiency can be improved by lowering the value of the prop argument.
The chain can be inspected to ensure good mixing using the default plot.chain = TRUE.
Data frame of two columns, giving the Gamma parameters ('shape' and 'mean') sampled from the chain, after burn-in and thinning.
Hastings, W.K., 1970. Monte Carlo sampling methods using Markov chains and their applications, Biometrika 57, 97-109.
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.