JuliaStats/Distributions.jl — pull request #172 by gjkerns (2014-01-06 15:10:00+00:00)
Title: Charfunc

Added support for the MGFs and characteristic functions of NoncentralChisq and Logistic distributions.
Feel free to edit to taste. These are standard formulas which are in the standard references, one of which being Johnson, Kotz, and Balakrishnan.

Notice that mgf(Logistic(0,1), 0) is undefined and the same thing happens for cf. It shouldn't be undefined; the correct value by continuity is 1. There should be an extra check for t = 0 to return 1. I'm not quite sure of the proper way to implement this in Julia and would like to hear what you think.

Notice that you have the same problem right now with the Uniform distribution:

julia> mgf(Uniform(0,1), 0)
NaN

The value should be 1 instead of NaN.