本文整理匯總了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));
}