gamma_params: Compute parameters of a gamma distribution

Description Usage Arguments Examples

View source: R/gamma-dist.R

Description

Given two parameters which characterize a gamma distribution, compute the remaining parameters in the following set shape, rate, scale, mean, mode, sd.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gamma_params(
  shape = NULL,
  rate = NULL,
  scale = NULL,
  mean = NULL,
  sd = NULL,
  mode = NULL,
  plot = FALSE,
  ...
)

Arguments

shape

shape parameter

rate

rate paramter

scale

scale parameter

mean

mean of gamma distribution

sd

standard deviation of gamma distribution

mode

mode of gamma distribution

plot

logical indicating whether a plot of the distribution should be displayed.

...

additional arguments passed to ggformula::gf_dist() to modify the plot produced if plot == TRUE.

Examples

1
2
3
4
5
gamma_params(10, 5)
gamma_params(10, scale = 5)
gamma_params(mean = 10, sd = 3)
gamma_params(mode = 10, sd = 3, plot = TRUE)
gamma_params(mean = 1, sd = 10, plot = TRUE)

rpruim/CalvinBayes documentation built on April 12, 2021, 1:49 p.m.