Description Usage Arguments Details Value Author(s) Examples
Gamma Shape and Rate Determine the shape and rate parameter of a gamma distribution, given its central tendency and spread.See the 'Details' section for constraints on which arguments may be used together.
1 | gammaParams(mean, mode, sd)
|
mean |
A numeric vector |
mode |
A numeric vector |
sd |
A numeric vector |
Only two parameters may be specified together. Specifically, one parameter relating to the distributions central tendency (i.e. mean or mode) must be specified with the standard deviation.
Named list with 2 elements: S = Gamma shape parameter (alpha) R = Gamma rate parameter (beta)
Will Hopper (2016) Inspired by functions writen by John Krushke to accompany his "Doing Bayesian Data Analysis" book. Kruschke, J. K. (2015). Doing Bayesian Data Analysis, Second Edition: A Tutorial with R, JAGS, and Stan. Academic Press / Elsevier.
1 2 3 4 5 | gammaParams(mean = 1.5, sd = 3)
gammaParams(mode = 2, sd = 3)
# Throws an error, because mean and mode cannot be used to find the shape and rate.
## Not run: gammaParams(mean = 2, mode = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.