FSharp.Stats
FSharp.Stats copied to clipboard
[Discussion] `Distributions.Continuous.ChiSquared.PDFLn`: unclear function
Describe what you wanna discuss about
The function (role) of the function Distributions.Continuous.ChiSquared.PDFLn is unclear. It is certainly not the ln result of ChiSquared.PDF since
Distributions.Continuous.ChiSquared.PDFLn 2. 4.7
// val it: float = -9.497437491
but
Distributions.Continuous.ChiSquared.PDF 2. 4.7 |> log
// val it: float = -3.043147181
// `log` is `System.Math.Log` which is a function/method to calculate ln of a given value
Triple-slash documentation states that it Computes the logarithm of probability density function. which should be the same as the last code block but it is not.
So, what actually DOES this function?
One possible approximation of the PDF is via the gamma function (p. 410). As defined in 26.4.19 it is:
PDF = incomplete gamma / gamma while v=2a and x²=2x. That would be PDFLn = incGammaLn - gammaLn, definetly worth a shot :+1:
abramowitz_and_stegun p 410 and p 470
One possible approximation of the PDF is via the gamma function (p. 410). As defined in 26.4.19 it is:
PDF = incomplete gamma / gammawhilev=2aandx²=2x. That would bePDFLn = incGammaLn - gammaLn, definetly worth a shot 👍
Will give it a try.