invgamma(probability,alpha,beta) equivalent of MS-Excel

71 views
Skip to first unread message

ignazio deiudicibus

unread,
Apr 28, 2014, 1:37:02 PM4/28/14
to jstat-...@googlegroups.com
Hi everyone,
after importing a MS-Excel Spreadsheet into Google Drive I found (well..not a surprisingly) that some statistical MS-Excel functions were not in it.
I'm trying to use jStat functions as custom functions of the imported google spreadsheet and I'd like to know if in jStat there's an equivalment for the MS-Excel GAMMAINV(probability;alpha;beta).

So far my assumptions/code:

//from jstat.js line 833

function gammapinv(p,a){
..
}

//from jstat.js line 1329
function gammainv(p, shape, scale) {
return scale / gammapinv(1 - p, shape);
};

thanks in advance
regards
Ignazio

Trevor Norris

unread,
Apr 28, 2014, 7:15:12 PM4/28/14
to jstat-...@googlegroups.com

Have you tried entering in the same values into jStat and Excel and see if the same values come out? AFAIK, no tests were added when those functions were introduced. So I'm not completely sure if they operate correctly.

ignazio deiudicibus

unread,
Apr 29, 2014, 2:37:07 AM4/29/14
to jstat-...@googlegroups.com

Hi Trevor,

I did the test and the results are quite different, so I think I'm extracting the wrong gammainv from the jstat code (the two (Excel,jstat) gammaln compute the same...

10,00001131 Excel-GAMMAINV(Prob;Alpha;Beta) 0,1448275529 custom_gammainv
0,068094 Probability
9 Alpha
2 Beta
2,651253879 Excel GAMMAINV(Prob) 2,651253879 custom_gammaln


regards
I


ignazio deiudicibus

unread,
Apr 29, 2014, 5:08:51 AM4/29/14
to jstat-...@googlegroups.com

Hi Trevor,

sorry for the "noise": jStat.gamma.inv(probability,alpha,beta) computes nearly the same of Excel (10.00001119143767).
Need more investigation...then

regards
Ignazio

Trevor Norris

unread,
May 12, 2014, 6:39:20 PM5/12/14
to jstat-...@googlegroups.com


On Tuesday, April 29, 2014 2:08:51 AM UTC-7, ignazio deiudicibus wrote:

sorry for the "noise": jStat.gamma.inv(probability,alpha,beta) computes nearly the same of Excel (10.00001119143767).
Need more investigation...then


No worries. Not like there's a ton going on here. :)

If you have any questions about the internals let me know.

/trev

Reply all
Reply to author
Forward
0 new messages