tensorflow / tensorflow/probability
PoissonLogNormalQuadratureCompound parameterization doesn't match LogNormal parameterization
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
What are loc and scale in this distribution.
Consider this:
import tensorflow_probability as tfp
import numpy as np
tfd = tfp.distributions
loc = 2.4
scale = 0.8
d1 = tfd.JointDistributionSequential([
tfd.LogNormal(loc, scale),
lambda z: tfd.Poisson(z)
])
d2 = tfd.PoissonLogNormalQuadratureCompound(loc, scale)
N = 100000
sample_1 = d1.sample(N)[1].numpy()
sample_2 = d2.sample(N).numpy()
sample_3 = np.random.poisson(np.random.lognormal(loc, scale , size=N))
print(sample_1.mean(), sample_1.var())
print(sample_2.mean(), sample_2.var())
print(sample_3.mean(), sample_3.var())
15.20101 217.6014
28675494000.0 5.8343047e+21
15.22877 224.11053428710002
Is it expected that the parameterization is different to LogNormal?
How can I obtain the "standard parameterization"? . I have tried to do log(scale) which gives closer but not correct answer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided Python snippet and inspect the implementation and documentation for PoissonLogNormalQuadratureCompound alongside LogNormal. Compare how loc and scale are interpreted and identify whether the discrepancy is in parameter handling or the documented behavior. Done means the parameterization is explained clearly and the reported mismatch is corrected or covered by an appropriate regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100