Search in sources :

Example 1 with BaseAbstractUnivariateIntegrator

use of org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator in project gatk by broadinstitute.

the class CNLOHCaller method calcEffectiveAlpha.

protected double calcEffectiveAlpha(final double[] effectivePhis) {
    final QAlphaUnivariateFunction qAlpha = new QAlphaUnivariateFunction(effectivePhis);
    final AQAlphaUnivariateFunction aQAlpha = new AQAlphaUnivariateFunction(effectivePhis);
    final BaseAbstractUnivariateIntegrator integrator = new SimpsonIntegrator();
    final double numerator = integrator.integrate(10, aQAlpha, MIN_E_ELPHA_INTEGRATION_RANGE, MAX_E_ELPHA_INTEGRATION_RANGE);
    final double denominator = integrator.integrate(10, qAlpha, MIN_E_ELPHA_INTEGRATION_RANGE, MAX_E_ELPHA_INTEGRATION_RANGE);
    return numerator / denominator;
}
Also used : SimpsonIntegrator(org.apache.commons.math3.analysis.integration.SimpsonIntegrator) BaseAbstractUnivariateIntegrator(org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator)

Example 2 with BaseAbstractUnivariateIntegrator

use of org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator in project gatk-protected by broadinstitute.

the class CNLOHCaller method calcEffectiveAlpha.

protected double calcEffectiveAlpha(final double[] effectivePhis) {
    final QAlphaUnivariateFunction qAlpha = new QAlphaUnivariateFunction(effectivePhis);
    final AQAlphaUnivariateFunction aQAlpha = new AQAlphaUnivariateFunction(effectivePhis);
    final BaseAbstractUnivariateIntegrator integrator = new SimpsonIntegrator();
    final double numerator = integrator.integrate(10, aQAlpha, MIN_E_ELPHA_INTEGRATION_RANGE, MAX_E_ELPHA_INTEGRATION_RANGE);
    final double denominator = integrator.integrate(10, qAlpha, MIN_E_ELPHA_INTEGRATION_RANGE, MAX_E_ELPHA_INTEGRATION_RANGE);
    return numerator / denominator;
}
Also used : SimpsonIntegrator(org.apache.commons.math3.analysis.integration.SimpsonIntegrator) BaseAbstractUnivariateIntegrator(org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator)

Aggregations

BaseAbstractUnivariateIntegrator (org.apache.commons.math3.analysis.integration.BaseAbstractUnivariateIntegrator)2 SimpsonIntegrator (org.apache.commons.math3.analysis.integration.SimpsonIntegrator)2