当前位置: 首页>>代码示例>>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;未经允许,请勿转载。