當前位置: 首頁>>代碼示例>>Java>>正文


Java SpecialMath類代碼示例

本文整理匯總了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);
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:11,代碼來源:TDistribution.java

示例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));
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:13,代碼來源:GammaDistribution.java

示例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));
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:11,代碼來源:BetaDistribution.java

示例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&lt;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);
        }
 
開發者ID:MesquiteProject,項目名稱:MesquiteArchive,代碼行數:11,代碼來源:FDistribution.java

示例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));
}
 
開發者ID:MesquiteProject,項目名稱:MesquiteArchive,代碼行數:12,代碼來源:GammaDistribution.java


注:本文中的JSci.maths.SpecialMath類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。