Open ZhuofanXie opened 4 years ago
The hyper-laplacian distribution is realized through a wrapper around the gamma distribution provided by scipy, where the mathematical relation between hyper-laplacian and gamma distributions is as the following:
For a random variable x satisfying a hyper-laplacian distribution with parameter k
and alpha
, its density p_x(x)
is proportional to exp(-k|x|^alpha)
. Hence p_{|x|^alpha}(y = |x|^{alpha})
is proportional to exp(-ky)y^{1/alpha - 1}, which is a gamma random variable with shape parameter 1/alpha and scale parameter 1/k.
Finally, the fitting method is realized by matching the theoretical mean and variance of abs(x)
with the empirical mean and variance. Specifically, we have E(|x|) = Gamma(2/alpha)/(Gamma(1/alpha)*k^{1/alpha})
, and E(x^2) = Gamma(3/alpha)/(Gamma(1/alpha)*k^{2/alpha})
. And we solve the equations using Newton’s method.
Description
Implement Hyper-Laplace distribution