hakaru-CS4ZP6 / hakaru

A probabilistic programming language
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Distributions without PDFs #36

Closed sohraa3 closed 6 years ago

sohraa3 commented 6 years ago

http://www.math.wm.edu/~leemis/chart/UDR/UDR.html

The two distributions "Doubly noncentral t" and "Kolmogorov–Smirnov", do not have a PDF in their description. How could these be implemented for the stdlib?

JacquesCarette commented 6 years ago

The paper https://cran.r-project.org/web/packages/sadists/sadists.pdf gives a simpler definition that Leemis. Pseudo-code:

doubly-noncentral-t(n,d,g)
   z <- normal d 1
   x <- chi-square g n
   return z/sqrt(x/n)

KS seems beyond hakaru for now.

JacquesCarette commented 6 years ago

I am taking myself off of this one, as I have answered the question. You should probably not close it until you've implemented it though.

mkhattab940 commented 6 years ago

I've been looking at this with @sohraa3. I'm not familiar with that parameterization of chi-squared. Is it just an iid version where there are n underlying normal distributions with mean = 0 and stddev = g?

JacquesCarette commented 6 years ago

Take a look at http://stat.ethz.ch/R-manual/R-devel/library/stats/html/Chisquare.html