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)
value of the mu parameter.
value of the sigma parameter.
the function returns a list with the mean and variance.
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.
Sáez-Castillo AJ, Conde-Sánchez A (2013). “A hyper-Poisson regression model for overdispersed and underdispersed count data.” Computational Statistics & Data Analysis, 61, 148--157.
# Example 1
# Theoretical values
mean_var_hp(mu=5.5, sigma=0.1)
#> $mean
#> [1] 6.399917
#>
#> $variance
#> [1] 5.500533
#>
# Using simulated values
y <- rHYPERPO(n=1000, mu=5.5, sigma=0.1)
mean(y)
#> [1] 6.484
var(y)
#> [1] 5.429173
# Example 2
# Theoretical values
mean_var_hp2(mu=5.5, sigma=1.9)
#> $mean
#> [1] 5.5
#>
#> $variance
#> [1] 6.345633
#>
# Using simulated values
y <- rHYPERPO2(n=1000, mu=5.5, sigma=1.9)
mean(y)
#> [1] 5.452
var(y)
#> [1] 6.482178