to_shape_rate_gamma {mixR}R Documentation

Parameter Conversion for Gamma Distribution

Description

The function to_shape_rate_gamma converts the mean and standard deviation to the shape and rate

Usage

to_shape_rate_gamma(mu, sd)

Arguments

mu

a numeric vector representing the means of gamma distributions

sd

a numeric vector representing the standard deviations of gamma distributions. mu and sd should have the same length.

Details

The purpose of this function is to convert the parameterization of gamma distribution in the form of mean and standard deviation to the form of shape and rate. It can be used for specifying the initial values for the EM algorithm when the first-hand initial values are in the form of mean and standard deviation from K-means clustering algorithm.

Value

a list of two items

alpha

a vector of the shapes of gamma distributions

lambda

a vector of the rates of gamma distributions

See Also

to_mu_sd_gamma

Examples

to_shape_rate_gamma(2, 1)
to_shape_rate_gamma(c(2, 4), c(1, 1))


[Package mixR version 0.2.0 Index]