You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I wanted to open a PR but I am not used to cabal but stack instead 😅. The following would be a possible solution although I am not sure about its performance.
importqualifiedStatistics.DistributionasDimportStatistics.Distribution.PoissonimportSystem.Random.MWC.CondensedTable (genFromTable, tablePoisson)
instanceD.ContGenPoissonDistributionwhere
genContVar p gen =fmapfromIntegral (genFromTable tPoisson gen)
where poi = poissonLambda p
tPoisson = tablePoisson poi
instanceD.DiscreteGenPoissonDistributionwhere
genDiscreteVar p gen =fmapround (D.genContVar p gen)
A simple test could be written since in average, E[X ~ Poisson(λ)] = λ
Problem with this approach is performance. Table takes some time to build and it only worth it if a lot of sample are generated. There's issue in mwc-random for that: haskell/mwc-random#27
Also you can build statistics with stack just as well. There isn't stack.yaml in repo but that's all
Right now it seems not possible due to how
DiscreteGen
/ContGen
typeclasses are defined.The text was updated successfully, but these errors were encountered: