I am trying to model some events that are asymptotically Poisson/Laplace distributed (i.e. the pmf/pdf has an exponential tail), but for short time periods has an interesting weekly periodic structure:
I have had difficulty modeling this using standard distributions because of its unique shape, and so I was considering implementing a custom distribution that could capture these peaks on short time scales, while also fitting the long tail.
I have a number of different ideas for how to formulate a pdf/pmf that might do the trick (exponential baseline with finite number of Gaussian bumps, or categorical distribution below some threshold and Poisson above it, etc.), and they are all relatively easy to implement
log_prob for, but then I realized that I might also need to implement a sampler, which for a distribution of this complexity is probably very involved and nontrivial! I know that for HMC the
sample method for a
Distribution is only called to initialize the first point so it is not needed for inference, but I want to use SVI because my dataset has millions of examples and will be very slow otherwise.
So my question is: do I need to implement a sampler to do inference with SVI? On the face of things I would expect the answer to be no because this site will be observed, so I think I would only need to implement
log_prob, but I’m not 100% sure. Also, does the
log_prob need to be normalized, or can I used an unnormalized distribution?
Bonus question: is there any way I can use standard torch/pyro distributions to fit this distribution? Perhaps some kind of mixture model?