Package org.apache.commons.math.distribution

Examples of org.apache.commons.math.distribution.NormalDistributionImpl


  }

  @Internal
  @DataParallel
  public static double dnorm(@Recycle double x, @Recycle double mean, @Recycle double sd, boolean log) {
    return d(new NormalDistributionImpl(mean, sd), x, log);
  }
View Full Code Here


    return d(new NormalDistributionImpl(mean, sd), x, log);
  }

  @DataParallel @Internal
  public static double pnorm(@Recycle double q, @Recycle double mean, @Recycle double sd, boolean lowerTail, boolean logP) {
    return p(new NormalDistributionImpl(mean, sd), q, lowerTail, logP);
  }
View Full Code Here

    return p(new NormalDistributionImpl(mean, sd), q, lowerTail, logP);
  }

  @DataParallel @Internal
  public static double plnorm(@Recycle double q, @Recycle double logmean, @Recycle double logsd, boolean lowerTail, boolean logP) {
    return p(new NormalDistributionImpl(logmean, logsd), Math.log(q), lowerTail, logP);
  }
View Full Code Here

    return p(new NormalDistributionImpl(logmean, logsd), Math.log(q), lowerTail, logP);
  }

  @DataParallel @Internal
  public static double qnorm(@Recycle double p, @Recycle double mean, @Recycle double sd, boolean lowerTail, boolean logP) {
    return q(new NormalDistributionImpl(mean, sd), p, lowerTail, logP);
  }
View Full Code Here

    return q(new NormalDistributionImpl(mean, sd), p, lowerTail, logP);
  }

  @DataParallel @Internal
  public static double qlnorm(@Recycle double p, @Recycle double meanlog, @Recycle double sdlog, boolean lowerTail, boolean logP) {
    return Math.exp(q(new NormalDistributionImpl(meanlog, sdlog), p, lowerTail, logP));
  }
View Full Code Here

    double y = Math.log(x) - mu;
    return 1/(x*Math.sqrt(2*Math.PI*sigma2)) * Math.exp(-y*y/(2*sigma2));
  }

  private double lognormalCDF(double x, double mu, double sigma) {
    NormalDistributionImpl z = new NormalDistributionImpl();
    double ans;
    try {
      ans = z.cumulativeProbability((Math.log(x)-mu)/sigma);
    } catch (MathException e) {
      if (Math.log(x) < mu) ans = 0;
      else ans = 1;
    }
    return ans;
View Full Code Here

    return median(v);
  }
 
  public static double normalCDF(double x, double mean, double sigma) throws MathException
  {
    NormalDistributionImpl normDist = new NormalDistributionImpl(mean, sigma);
    double ret = normDist.cumulativeProbability(x);
    return ret;
  }
View Full Code Here

    return ret;
  }
 
  public static double normalInverseCDF(double pValue, double mean, double sigma) throws MathException
  {
    NormalDistributionImpl normDist = new NormalDistributionImpl(mean, sigma);
    double ret = normDist.inverseCumulativeProbability(pValue);
    return ret;
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.math.distribution.NormalDistributionImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.