Talk:Welch's t-test: Difference between revisions
→lngamma: new section
(→lngamma: new section) |
|||
Line 104:
}
</lang> that I could paste into my code?--[[User:Hailholyghost|Hailholyghost]] ([[User talk:Hailholyghost|talk]]) 18:22, 8 July 2015 (UTC)
== lngamma ==
You can build an adequate lngamma from the rosettacode [[Gamma_function|gamma function]] implementation, something like this:
<lang pseudocode>function lngamma(x) {
if x < 3 then
return ln(gamma(x))
else
frac= x mod 1
r= ln(gamma(1+frac))
for index= 1 thru x-1
r= r + ln(index+frac)
end for
return r
end if
end function</lang>
(I think I got that right - this is based on an email from [[User:Roger_Hui|Roger Hui]], but I've adapted it from J to pseudo-code. Any errors are my own. Except errors in the gamma function implementation - those might be someone else's. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 20:23, 8 July 2015 (UTC))
|