Package fork.lib.math.applied.stat

Examples of fork.lib.math.applied.stat.Distribution.median()


}
   
   
public static void subtractBackground(Distribution dis, File f, File outSub, double rat)throws Exception {
    Distribution dislow= dis.subsetLowerThan(dis.quantileBoundaries(100).get(99));
    double med= dislow.median();
    double sd= dislow.standartDeviation();
    double thr= med+ sd* rat;
    System.out.println("med: "+ med+"   sd: "+ sd+"     trh:"+ thr);
   
   
View Full Code Here


        }
    }
    out= out.substring(0, out.length()-1);
    out+=")";
    out+="\nmu:"+dis.mean()+"   zero:"+ (double)dis.subsetLowerOrEqualTo(0).size()/dis.size()
            +"  me:"+dis.median()+"   s:"+dis.standartDeviation();
    return out;
}
   
   
   
View Full Code Here

   


public static void normalise(LandscapeBuilder lb, File f, String tit) throws Exception{
    Distribution d= lb.getDistribution();
    double fac= (double)Math.ceil( d.median() * 1.75);
    new LandscapeTransformer(lb).subtract(fac);
    System.out.println("subfac: "+fac);
   
    Distribution dnz= lb.getDistributionNonZero();
    double nf= dnz.sum()/ 100000000;
View Full Code Here

   
public void subtract2()throws Exception {
    Distribution dis= new BedGraphBuffer(outSub).getDistributionNonZero();
    dis= dis.subsetLowerThan(dis.quantileBoundaries(10).get(7));
    double med= dis.median();
    double sd= dis.standartDeviation();
    double thr= med+ sd* 2;
    System.out.println("med: "+ med+"   sd: "+ sd+"     "+ thr);

    BufferedWriter bw= new BufferedWriter(new FileWriter(outSub2));
View Full Code Here

    ArrayList<Double> qs= d.quantileBoundaries(100);
    double m=0 ,sd=0;
    for( int i=0; i<50; i++ ){
        Distribution df= d.subset(qs.get(i), qs.get(qs.size()-1-i), true, true);
        m= df.mean();
        double med= df.median();
        sd= df.standartDeviation();
        double z= sd/m;
        //System.out.println(i+"   mean: "+m+"   med: "+med+"   sd: "+ sd+"  z:"+z);
        if(z<0.2){
            break;
View Full Code Here

   
protected void init() throws Exception{
    Distribution d= new Distribution();
    d.add(lbf.getDistribution());
    d.add(lbr.getDistribution());
    double med= Math.ceil( d.median() *1.7 );
    double sd= d.standartDeviation();
    System.out.println("med:  "+med +"    sd:  "+sd);
    //d.print(); System.exit(1);
    new LandscapeTransformer(lbf).subtract(med);
    new LandscapeTransformer(lbr).subtract(med);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.