本文整理汇总了Java中JSci.maths.SpecialMath类的典型用法代码示例。如果您正苦于以下问题:Java SpecialMath类的具体用法?Java SpecialMath怎么用?Java SpecialMath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpecialMath类属于JSci.maths包,在下文中一共展示了SpecialMath类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TDistribution
import JSci.maths.SpecialMath; //导入依赖的package包/类
/**
* Constructor for student's t-distribution.
* @param r degrees of freedom.
*/
public TDistribution(int r) {
if(r<=0)
throw new OutOfRangeException("The degrees of freedom must be greater than zero.");
dgrFreedom=r;
logPdfFreedom=-SpecialMath.logBeta(0.5*dgrFreedom,0.5)-0.5*Math.log(dgrFreedom);
}
示例2: probability
import JSci.maths.SpecialMath; //导入依赖的package包/类
/**
* Probability density function of a gamma distribution.
* P(X) = X<sup>s-1</sup> e<sup>-X</sup>/<img border=0 alt="Gamma" src="../doc-files/ugamma.gif">(s).
* @return the probability that a stochastic variable x has the value X, i.e. P(x=X).
*/
public double probability(double X) {
checkRange(X,0.0,Double.MAX_VALUE);
if(X==0.0)
return 0.0;
else
return Math.exp(-SpecialMath.logGamma(shape)-X+(shape-1)*Math.log(X));
}
示例3: probability
import JSci.maths.SpecialMath; //导入依赖的package包/类
/**
* Probability density function of a beta distribution.
* @return the probability that a stochastic variable x has the value X, i.e. P(x=X).
*/
public double probability(double X) {
checkRange(X);
if(X==0.0 || X==1.0)
return 0.0;
return Math.exp(-SpecialMath.logBeta(p,q)+(p-1.0)*Math.log(X)+(q-1.0)*Math.log(1.0-X));
}
示例4: cumulative
import JSci.maths.SpecialMath; //导入依赖的package包/类
/**
* Cumulative F-distribution function.
* @return the probability that a stochastic variable x is less then X, i.e. P(x<X).
*/
public double cumulative(double X) {
// We make use of the fact that when x has an F-distibution then
// y = q/(q+p*x) has a beta distribution with parameters p/2 and q/2.
checkRange(X,0.0,Double.MAX_VALUE);
return SpecialMath.incompleteBeta(1.0/(1.0+q/(p*X)),p/2.0,q/2.0);
}
示例5: probability
import JSci.maths.SpecialMath; //导入依赖的package包/类
/**
* Probability density function of a gamma distribution.
* @return the probability that a stochastic variable x has the value X, i.e. P(x=X).
*/
public double probability(double X) {
checkRange(X,0.0,Double.MAX_VALUE);
if(X==0.0)
return 0.0;
else
return Math.exp(-SpecialMath.logGamma(shape)-X+(shape-1)*Math.log(X));
}