cgarling / StarFormationHistories.jl

Fitting astrophysical star formation histories via CMD modelling.
MIT License
3 stars 0 forks source link

Implement Poisson likelihood separately from Poisson likelihood ratio #28

Closed cgarling closed 4 months ago

cgarling commented 4 months ago

Currently using Poisson likelihood ratio (PLR) but I think we can just use simple Poisson loglikelihood instead. In the PLR the factorial in the denominator cancels with numerator, but when taking the logarithm of the likelihood it becomes a logfactorial which has an efficient implementation in SpecialFunctions.jl that we can use, so it's not clear what benefit the PLR has. We should at least look at using the Poisson likelihood directly.

cgarling commented 4 months ago

Tested new implementation in new_likelihood branch, see commit debd3fa8ff5ddc31448fd9bb525f3d7c681f2925. Gradient of Poisson loglikelihood is same as log-PLR, so only difference is objective. Convergence of MLE/MAP estimators is mostly the same under both, perhaps slightly better under PLR. HMC under basic Poisson likelihood shows poorer initial performance than using PLR.