Using a method of moments approach, converts a sample with a specified mean and variance to a parameterization of a gamma distribution

gamma_shape(mv)

gamma_rate(mv)

Arguments

mv

A two-element numeric vector c(mean, variance)

Value

A number representing the shape or rate parameter

Details

Implemented as:

pri_gamma_shape <- function(mv) (mv[1]^2)/mv[2] pri_gamma_rate <- function(mv) mv[1]/mv[2]