JuliaStats / Distributions.jl

A Julia package for probability distributions and associated functions.
Other
1.11k stars 417 forks source link

moment generating function for Beta distribution #244

Open maxbaroi opened 10 years ago

maxbaroi commented 10 years ago

I'm not sure if this is the best place to post this (I'm new to working with strangers on the internet).

I'm trying to write the mgf/cf for the Beta distribution and some other distributions. So I was wondering...

1) Is this a worthwhile endeavor? Would anyone care about this feature asides from the sake of completion?

2) Am I wasting my time? Is there already a hypergeometric function library I can just borrow from?

3) Should Distributions.jl even have hypergemometric functions defined within? Should I just venture off and write a seperate library? Though it would seem silly to add a dependency for the sake of having (mg/c)fs for a smallish subset of distributions.

Nice package by the way. It's been a pleasant migration from R to Julia.

johnmyleswhite commented 10 years ago

(1) There are a lot of moment generating functions already implemented. So we'd like to have one for the Beta distribution if we don't already.

(2) Unless you're an expert, I'd be cautious about writing code to evaluate hypergeometric functions from scratch. Which functions do you need?

(3) No, hypergeometric functions should be in Base or a special package (like Specials.jl) rather than in Distributions.jl.

Glad you've enjoyed this package.

cossio commented 8 years ago

@maxbaroi

1) I have a use case for this right now. Briefly, when computing the convolution of Beta distributions numerically, the Fourier transform very useful.

2) Right now I am calling Python's mpmath to get the hyp1f1 of complex arguments (which is the characteristic function of the Beta distribution), so I think there is no Julia implementation at the moment.