I have a question about how to use the distribution functions within the jstat library. Specifically, I am focused on studentt.
I've tried this:
var alphaLevel = 0.05;
var degreesOfFreedom = 18;
// the answer I want to get is 2.100922
tStat = jStat.studentt(alphaLevel,degreesOfFreedom);
// but all that is returned is an object with
// members _a,_b,_c (_a=alphaLevel, _b=degreesOfFreedom,_c=undefined).
As explained on the jstat github site, there is a difference between static and instance functions. However, it is above my experience with javascript as to how to do this.
Can anyone explain how to properly call the studentt function and get the proper result?
Thank you!
The usage follows this documentation: http://jstat.github.io/distributions.html#jStat.studentt
So in your example you have two options. Either you can get the result immediately:
var tStat = jStat.studentt.pdf(alphaLevel, degreesOfFreedom);
Or you can return an instance that allows you to pass in multiple values of alpha:
var tStat = jStat.studentt(degreesOfFreedom);
var a1 = tStat.pdf(alpha1);
var a2 = tStat.pdf(alpha2);