• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Erf类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.commons.math.special.Erf的典型用法代码示例。如果您正苦于以下问题:Java Erf类的具体用法?Java Erf怎么用?Java Erf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Erf类属于org.apache.commons.math.special包,在下文中一共展示了Erf类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSignificance

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * Computes the significance of the difference between two correlations.
 * @see org.tud.sir.util.statistics.Significance.testCorrelations
 */
public static double getSignificance(double correlation1, double correlation2, int n1, int n2) throws MathException {
    
    // transform to Fisher Z-values
    double zv1 = FisherZTransformation.transform(correlation1);
    double zv2 = FisherZTransformation.transform(correlation2);

    // difference of the Z-values
    double zDifference = (zv1 - zv2) / Math.sqrt(2d) / Math.sqrt( (double)1/(n1-3) + (double)1/(n2-3));
    
    // get p value from the complementary error function
    double p = Erf.erfc( Math.abs(zDifference));
    return p;
}
 
开发者ID:dkpro,项目名称:dkpro-statistics,代码行数:18,代码来源:Significance.java


示例2: generatePixelSignature

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * Computes the relative probability of receiving a photon at the pixel. 
 * @param pixelX The pixel's x-position.
 * @param pixelY The pixel's y-position.
 * @return The probability of a photon hitting this pixel.
 * @throws org.apache.commons.math.MathException
 */
@Override
public double generatePixelSignature(int pixelX, int pixelY)
        throws MathException {
    final double sigma_0 = this.FWHM / 2.3548;
    final double zR = 2 * sigma_0 / this.numericalAperture; // Rayleigh range
    
    // Add the offset from the stage's position to the emitter's z-values
    double z;
    z = this.eZ + this.stageDisplacement;
    
    double sigma = sigma_0 * sqrt(1 + (z/ zR) * (z / zR));
    double denom = sqrt(2.0)*sigma;
    return 0.25 *(Erf.erf((pixelX - this.eX + 0.5)/denom) - 
                  Erf.erf((pixelX - this.eX - 0.5)/denom)) *
                 (Erf.erf((pixelY - this.eY + 0.5)/denom) -
                  Erf.erf((pixelY - this.eY - 0.5)/denom));
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:25,代码来源:Gaussian3D.java


示例3: cumulativeProbability

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
    * For this distribution, X, this method returns P(X &lt; <code>x</code>).
    *
    * @param x the value at which the CDF is evaluated.
    * @return CDF evaluted at <code>x</code>.
    * @throws MathException if the algorithm fails to converge; unless
    *                       x is more than 20 standard deviations from the mean, in which case the
    *                       convergence exception is caught and 0 or 1 is returned.
    */
   @Override
public double cumulativeProbability(double x) throws MathException {
       try {
           return 0.5 * (1.0 + Erf.erf((x - mean) /
                   (standardDeviation * Math.sqrt(2.0))));
       } catch (MaxIterationsExceededException ex) {
           if (x < (mean - 20 * standardDeviation)) { // JDK 1.5 blows at 38
               return 0.0d;
           } else if (x > (mean + 20 * standardDeviation)) {
               return 1.0d;
           } else {
               throw ex;
           }
       }
   }
 
开发者ID:CompEvol,项目名称:beast2,代码行数:25,代码来源:NormalDistributionImpl.java


示例4: cumulativeProbability

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * For this distribution, X, this method returns P(X &lt; <code>x</code>).
 * @param x the value at which the CDF is evaluated.
 * @return CDF evaluted at <code>x</code>. 
 * @throws MathException if the algorithm fails to converge; unless
 * x is more than 20 standard deviations from the mean, in which case the
 * convergence exception is caught and 0 or 1 is returned.
 */
public double cumulativeProbability(double x) throws MathException {
    try {
        return 0.5 * (1.0 + Erf.erf((x - mean) /
                (standardDeviation * Math.sqrt(2.0))));
    } catch (MaxIterationsExceededException ex) {
        if (x < (mean - 20 * standardDeviation)) { // JDK 1.5 blows at 38
            return 0.0d;
        } else if (x > (mean + 20 * standardDeviation)) {
            return 1.0d;
        } else {
            throw ex;
        }
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:NormalDistributionImpl.java


示例5: generatePixelSignature

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * Computes the relative probability of receiving a photon at the pixel.
 * (emitterX, emitterY). The z-position of the emitter is ignored.
 * @param pixelX The pixel's x-position.
 * @param pixelY The pixel's y-position.

 * @return The probability of a photon hitting this pixel.
 * @throws org.apache.commons.math.MathException
 */
@Override
public double generatePixelSignature(int pixelX, int pixelY)
        throws MathException {
    final double sigma = this.FWHM / 2.3548;
    final double denom = sqrt(2.0)*sigma;
    return 0.25 *(Erf.erf((pixelX - this.eX + 0.5)/denom) - 
                  Erf.erf((pixelX - this.eX - 0.5)/denom)) *
                 (Erf.erf((pixelY - this.eY + 0.5)/denom) -
                  Erf.erf((pixelY - this.eY - 0.5)/denom));
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:20,代码来源:Gaussian2D.java


示例6: generate_signature_for_pixel

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * This function should implement the new PSF shape for the 3D fluorophore
 * @param x x-position of camera pixel
 * @param y y-position of camera pixel
 * @param camera_fwhm_digital fwhm of gaussian PSF
 * @return normalized value of pixel brightness (ie how bright is this particular
 * pixel due to emission from the relevant fluorophore)
 * @throws MathException 
 */
@Override
protected double generate_signature_for_pixel(int x, int y, double camera_fwhm_digital) throws MathException {
    final double sigma = camera_fwhm_digital / 2.3548;
    final double denom = sqrt(2.0)*sigma;
    
    // this is just an example of a z-dependent PSF, it is not the physically
    // accurate normalized PSF, I just made one up so it could be demonstrated
    double z_factor = Math.exp(z);
    
    return 0.25 *(Erf.erf(z_factor*(x-this.x+0.5)/denom) - Erf.erf(z_factor*(x-this.x-0.5)/denom)) *
                 (Erf.erf((y-this.y+0.5)/denom/z_factor) - Erf.erf((y-this.y-0.5)/denom/z_factor));
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:22,代码来源:Fluorophore3D.java


示例7: cumulativeProbability

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * For this disbution, X, this method returns P(X &lt; <code>x</code>).
 * @param x the value at which the CDF is evaluated.
 * @return CDF evaluted at <code>x</code>. 
 * @throws MathException if the algorithm fails to converge; unless
 * x is more than 20 standard deviations from the mean, in which case the
 * convergence exception is caught and 0 or 1 is returned.
 */
public double cumulativeProbability(double x) throws MathException {
    try {
        return 0.5 * (1.0 + Erf.erf((x - mean) /
                (standardDeviation * Math.sqrt(2.0))));
    } catch (MaxIterationsExceededException ex) {
        if (x < (mean - 20 * standardDeviation)) { // JDK 1.5 blows at 38
            return 0.0d;
        } else if (x > (mean + 20 * standardDeviation)) {
            return 1.0d;
        } else {
            throw ex;
        }
    }
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:23,代码来源:NormalDistributionImpl.java


示例8: cumulativeProbability

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * For this distribution, X, this method returns P(X &lt; <code>x</code>).
 * @param x the value at which the CDF is evaluated.
 * @return CDF evaluted at <code>x</code>.
 * @throws MathException if the algorithm fails to converge; unless
 * x is more than 20 standard deviations from the mean, in which case the
 * convergence exception is caught and 0 or 1 is returned.
 */
public double cumulativeProbability(double x) throws MathException {
    try {
        return 0.5 * (1.0 + Erf.erf((x - mean) /
                (standardDeviation * Math.sqrt(2.0))));
    } catch (MaxIterationsExceededException ex) {
        if (x < (mean - 20 * standardDeviation)) { // JDK 1.5 blows at 38
            return 0.0d;
        } else if (x > (mean + 20 * standardDeviation)) {
            return 1.0d;
        } else {
            throw ex;
        }
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:NormalDistributionImpl.java


示例9: erf

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * Return the value of the error function calculated using the Apache Commons Math.
 * @param x Where to evaluate the error function at.
 * @return the value of the error function evaluated at x.
 */
public static double erf(double x)
{
		try
		{
			double value = Erf.erf(x);
			return value;
		}
		catch (MathException e)
		{
			throw new afest.math.exceptions.MathException("Algorithm failed to converge! "+e.getMessage());
		}
}
 
开发者ID:williamleif,项目名称:PSRToolbox,代码行数:18,代码来源:MyStats.java


示例10: cumulativeProbability

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * For this distribution, X, this method returns P(X &lt; <code>x</code>).
 *
 * @param x the value at which the CDF is evaluated.
 * @return CDF evaluted at <code>x</code>.
 * @throws MathException if the algorithm fails to converge; unless
 *                       x is more than 20 standard deviations from the mean, in which case the
 *                       convergence exception is caught and 0 or 1 is returned.
 */
public double cumulativeProbability(double x) throws MathException {
    try {
        return 0.5 * (1.0 + Erf.erf((x - mean) /
                (standardDeviation * Math.sqrt(2.0))));
    } catch (MaxIterationsExceededException ex) {
        if (x < (mean - 20 * standardDeviation)) { // JDK 1.5 blows at 38
            return 0.0d;
        } else if (x > (mean + 20 * standardDeviation)) {
            return 1.0d;
        } else {
            throw ex;
        }
    }
}
 
开发者ID:rbouckaert,项目名称:YABBY,代码行数:24,代码来源:NormalDistributionImpl.java


示例11: generate_signature_for_pixel

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * Returns the signature that this emitter leaves on a given pixel (what
 * fraction of this emitter's photons hits this particular pixel).
 * @param x pixel x-position
 * @param y pixel y-position
 * @param camera_fwhm_digital camera fwhm value
 * @return signature value for this pixel
 * @throws MathException
 * @deprecated This behavior has been moved to the PSF interface
 */
@Deprecated
protected double generate_signature_for_pixel(int x, int y, double camera_fwhm_digital) throws MathException {
    final double sigma = camera_fwhm_digital / 2.3548;
    final double denom = sqrt(2.0)*sigma;
    return 0.25 *(Erf.erf((x-this.x+0.5)/denom) - Erf.erf((x-this.x-0.5)/denom)) *
                 (Erf.erf((y-this.y+0.5)/denom) - Erf.erf((y-this.y-0.5)/denom));
}
 
开发者ID:LEB-EPFL,项目名称:SASS,代码行数:18,代码来源:Emitter.java


示例12: cumulativeProbability

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * For this distribution, {@code X}, this method returns {@code P(X < x)}.
 * If {@code x}is more than 40 standard deviations from the mean, 0 or 1 is returned,
 * as in these cases the actual value is within {@code Double.MIN_VALUE} of 0 or 1.
 *
 * @param x Value at which the CDF is evaluated.
 * @return CDF evaluated at {@code x}.
 * @throws MathException if the algorithm fails to converge
 */
public double cumulativeProbability(double x) throws MathException {
    final double dev = x - mean;
    if (FastMath.abs(dev) > 40 * standardDeviation) {
        return dev < 0 ? 0.0d : 1.0d;
    }
    return 0.5 * (1 + Erf.erf(dev / (standardDeviation * FastMath.sqrt(2))));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:17,代码来源:NormalDistributionImpl.java


示例13: cumulativeProbability

import org.apache.commons.math.special.Erf; //导入依赖的package包/类
/**
 * For this disbution, X, this method returns P(X &lt; <code>x</code>).
 * @param x the value at which the CDF is evaluated.
 * @return CDF evaluted at <code>x</code>. 
 * @throws MathException if the algorithm fails to converge.
 */
public double cumulativeProbability(double x) throws MathException {
    return 0.5 * (1.0 + Erf.erf((x - mean) /
            (standardDeviation * Math.sqrt(2.0))));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:NormalDistributionImpl.java



注:本文中的org.apache.commons.math.special.Erf类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ITheOneProbe类代码示例发布时间:2022-05-23
下一篇:
Java AlipayTradeRefundResponse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap