betaParams: Beta a & b Determine the shape parameters of a beta...

Description Usage Arguments Details Value Author(s) Examples

View source: R/stats.R

Description

Beta a & b Determine the shape parameters of a beta distribution, given its central tendency and spread. See 'Details' section for constraints on which arguments may be used together.

Usage

1

Arguments

mean

A numeric scalar in range (0,1)

mode

A numeric scalar in range (0,1)

kappa

A numeric scalar in range (0,Inf).

sd

A numeric scalar in range (0,Inf)

Details

Only two arguments may be specified together. Specifically, one parameter relating to the distributions central tendency (i.e. mean or mode) must be specified with one parameter relating to its spread (i.e. kappa or sd). Additionally, not all combinations of (mean,mode) and (kappa, sd) are valid; Solutions exist using mean and kappa, mean and sd, and mode and kappa. No solution for the shape parameters using the mode and kappa is used.

The kappa parameter refers to the concentration of the beta distribution. As such, it is negatively related to the standard deviation.

Value

Named list with 2 elements: a = Beta shape parameter #1, b = Beta shape parameter #2

Author(s)

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.

Examples

1
2
3
4
5
6
7
betaParams(mean = .6, kappa=15)
betaParams(mode = .25, kappa=15)
betaParams(mean = .6, kappa=15)

# Throws an error, because you need one measure of central tendency and one of spread, while
# sd and kappa are both measures of spread.
## Not run: betaParams(sd = .2, kappa=15)

wjhopper/whoppeR documentation built on May 4, 2019, 7:33 a.m.