pisa.utils.llh_defs package¶
Submodules¶
pisa.utils.llh_defs.poisson module¶
Relevant Poisson generalizations from the paper:
https://arxiv.org/abs/1712.01293
and the newer one:
https://arxiv.org/abs/1902.08831
All formulas return the log-likelihood or log-probability Formulas are not optimized for speed, but for clarity (except c implementations to some extent). They can definately be sped up by smart indexing etc., and everyone has to adjust them to their use case anyway. Formulas are not necessarily vetted, please try them out yourself first.
Any questions: thorsten.gluesenkamp@fau.de
NOTE:¶
This code has been heavily modified from its original version. To view the original source, check out the git below:
- pisa.utils.llh_defs.poisson.bars_and_stars_iterator(tot_k, num_bins)[source]¶
Function used to compute generalization 2 (eq. 47 of 1902.08831 ). used to calculate the convolution of N poisson-gamma mixtures in a safe way.
- pisa.utils.llh_defs.poisson.calc_pg(k, alpha, beta)[source]¶
Function used to compute generalization 2 (eq. 47 of 1902.08831 ).
calculate single poisson gamma mixture in calc_pg vectorized over alpha/beta
- pisa.utils.llh_defs.poisson.fast_pgmix(k, alphas=None, betas=None)[source]¶
Core function that computes the generalized likelihood 2
- pisa.utils.llh_defs.poisson.generalized_pg_mixture_2nd(k, alphas, betas)[source]¶
Function used to compute generalization 2 (eq. 47 of 1902.08831 ).
second way to calculate generalized pg mixture, based on iterative sum
pisa.utils.llh_defs.poisson_gamma_mixtures module¶
- pisa.utils.llh_defs.poisson_gamma_mixtures.c_generalized_pg_mixture(k, alphas, betas)¶
- pisa.utils.llh_defs.poisson_gamma_mixtures.c_generalized_pg_mixture_marginalized(k, gammas, deltas, epsilons)¶
- pisa.utils.llh_defs.poisson_gamma_mixtures.c_generalized_pg_mixture_marginalized_combined(k, alphas, betas, gammas, alphas_2, betas_2)¶
- pisa.utils.llh_defs.poisson_gamma_mixtures.c_multi_pgg(k, A, B, Q, kmc, gamma, log_sterlings)¶
- pisa.utils.llh_defs.poisson_gamma_mixtures.c_single_pgg(k, A, B, Q, kmc, gamma, log_sterlings)¶