| mean_var_hp | R Documentation | 
This function calculates the mean and variance for the
hyper-Poisson distribution with parameters \mu and \sigma.
mean_var_hp(mu, sigma)
mean_var_hp2(mu, sigma)
mu | 
 value of the mu parameter.  | 
sigma | 
 value of the sigma parameter.  | 
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.
the function returns a list with the mean and variance.
Freddy Hernandez, fhernanb@unal.edu.co
saez2013hyperpoDiscreteDists
HYPERPO.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.