mean_var_hp: Mean and variance for hyper-Poisson distribution

View source: R/mean_var_hp.R

mean_var_hpR Documentation

Mean and variance for hyper-Poisson distribution

Description

This function calculates the mean and variance for the hyper-Poisson distribution with parameters \mu and \sigma.

Usage

mean_var_hp(mu, sigma)

mean_var_hp2(mu, sigma)

Arguments

mu

value of the mu parameter.

sigma

value of the sigma parameter.

Details

The hyper-Poisson distribution with parameters \mu and \sigma has a support 0, 1, 2, ... and density given by

f(x | \mu, \sigma) = \frac{\mu^x}{_1F_1(1;\mu;\sigma)}\frac{\Gamma(\sigma)}{\Gamma(x+\sigma)}

where the function _1F_1(a;c;z) is defined as

_1F_1(a;c;z) = \sum_{r=0}^{\infty}\frac{(a)_r}{(c)_r}\frac{z^r}{r!}

and (a)_r = \frac{\gamma(a+r)}{\gamma(a)} for a>0 and r positive integer.

This function calculates the mean and variance of this distribution.

Value

the function returns a list with the mean and variance.

Author(s)

Freddy Hernandez, fhernanb@unal.edu.co

References

\insertRef

saez2013hyperpoDiscreteDists

See Also

HYPERPO.

Examples

# Example 1

# Theoretical values
mean_var_hp(mu=5.5, sigma=0.1)

# Using simulated values
y <- rHYPERPO(n=1000, mu=5.5, sigma=0.1)
mean(y)
var(y)


# Example 2

# Theoretical values
mean_var_hp2(mu=5.5, sigma=1.9)

# Using simulated values
y <- rHYPERPO2(n=1000, mu=5.5, sigma=1.9)
mean(y)
var(y)

DiscreteDists documentation built on Sept. 14, 2024, 1:07 a.m.