Example usage for org.apache.commons.math3.distribution GammaDistribution density

List of usage examples for org.apache.commons.math3.distribution GammaDistribution density

Introduction

In this page you can find the example usage for org.apache.commons.math3.distribution GammaDistribution density.

Prototype

public double density(double x) 

Source Link

Usage

From source file:distributions.Gamma.java

public void process(int pickedinstances, int totalinstances, int deletedattribute) {
    System.out.println("Process");
    double value;
    double gamma_func_r;
    computeMean();/*w  w w  .  j  a  va2s.  co  m*/
    computevariance();
    //computeparameters();
    gamma_func_r = factorial((int) (alfa - 1));
    ///compute gamma distribution
    GammaDistribution gd = new GammaDistribution(alfa, beta);
    for (int row = 0; row < data.length; row++) {
        //value = getGammaDistribution(gamma_func_r, normalizedData[row], alfa, beta);
        value = gd.density(normalizedData[row]);
        Prob[row] = value;
        System.out.println(Prob[row]);
    }
    //generateCSVFile();
    //find the pairs of the picked instances to delete
    findpairs(pickedinstances, totalinstances);
    //delete the attribue of the instances to create missign data set
    deletedata(deletedattribute);
    generateCSVFile();

    for (int i = 0; i < data.length; i++) {
        System.out.print("\n");
        for (int j = 0; j < data[0].length; j++) {
            System.out.print(data[i][j] + "\t");
        }
        // System.out.print("\n");
    }
}

From source file:org.structnetalign.weight.GammaScorer.java

public double score(SequencePair<ProteinSequence, AminoAcidCompound> pair, double score) {
    GammaDistribution dist = new GammaDistribution(alpha, lambda);
    return dist.density(score + beta);
}