INVCHISQRPARMS Function |
%InvChiSqrParms(mean,sd) returns a 2-vector (degrees of freedom and scale in that order) with the two parameters for an inverse scaled chi-squared distribution with the given mean and standard deviation.
If the s.d. is %NA (infinite), degrees of freedom if 4, which is the largest value for which the variance is undefined. Parameters for the closely-related inverse gamma can be done with the %INVGAMMAPARMS function.
Example
(The SOURCE needs to be done once)
source invchisqrparms.src
compute icparms=%invchisqrparms(2.0,1.0)
set test 1 10000 = (icparms(2)*icparms(1))/%ranchisqr(icparms(1))
stats test
will create a series named TEST with inverse chi-squareds with (population) mean 2 and standard deviation 1.
Copyright © 2025 Thomas A. Doan