Open sohraa3 opened 6 years ago
Yes. I think it's called gammaFunction
. Search the prelude.
I am going to close this, as I believe the above comment should solve the problem. If not, then reopen and post something more concrete (as per what I just posted in #35)
I looked in the prelude and the function is called gammaFunc
. However, I get this error when I try to run the hakaru command on the following .hk program: return gammaFunc(5)
1.0 hakaru: TODO: evaluatePrimOp{GammaFunc}
CallStack (from HasCallStack):
error, called at haskell/Language/Hakaru/Sample.hs:382:5 in hakaru-0.6.0
AbnzUW5EnqjBuQmLn3LJbU:Language.Hakaru.Sample
Should gammaFunc only be used for symbolic manipulation and not evaluating/sampling ?
I'm surprised that gammaFunc
isn't implemented in the Sampler. It wouldn't be hard to do!
But it should definitely work for symbolic manipulation.
I have put all the sampler functions that are for symbolic representations (not able to generate samples) in a file called symbolic.hk in stdlib. These are the ones that include infinite operations. I was wondering if I should put the ones that include gamma function in the same file since they can't be used for generating samples?
Later when gammaFunc gets implemented, they can be moved to their corresponding files.
Sure, sounds like a plan.
http://www.math.wm.edu/~leemis/chart/UDR/UDR.html
Some of the distributions have the gamma function Γ() in their PDFs which seems like its computation involves infinite product. Is there a primitive built in function for it in hakaru? Examples:Error, Generalized gamma, Noncentral F