00001 package commandline.Distributions;
00002
00003 import commandline.ImageStuff.GeometricObjects.GenericEdge;
00004
00005 public abstract class NormalIndicesDistribution {
00006
00007 public NormalIndicesDistribution() {
00008 super();
00009
00010 }
00011
00022 protected abstract double evaluatePDF(double x,float A_0,float A_1,GenericEdge edge);
00023
00024
00034 public double[] getPMF(float H,float length,int L,float n_0,float n_1){
00035 double[] PMF=new double[L];
00036 float total=0;
00037 float interval=length/(L-1);
00038 float x;
00039 for(int i=0;i!=PMF.length;i++){
00040 x=i*interval;
00041
00042 PMF[i]=evaluatePDF(x,n_0,n_1,null);
00043 total+=PMF[i];
00044 }
00045 for(int i=0;i!=PMF.length;i++){
00046 PMF[i]/=total;
00047 }
00048 return PMF;
00049 }
00050
00051
00052 public double[] getPMF_disc(GenericEdge e){
00053 double[] PMF=new double[e.getLengte()];
00054
00055 for(int i=0;i!=PMF.length;i++){
00056 PMF[i]=evaluatePDF(i,VerticalDistribution_discr.UNUSED,VerticalDistribution_discr.UNUSED,e);
00057
00058 }
00059
00060 return normalize(PMF);
00061 }
00062
00063 protected double[] normalize(double[] PMF){
00064 float total=0;
00065 for(int i=0;i!=PMF.length;i++){
00066 total+=PMF[i];
00067 }
00068 for(int i=0;i!=PMF.length;i++){
00069 PMF[i]/=total;
00070 }
00071 return PMF;
00072 }
00073
00074
00081 public static float scaleLambaEstimator(float lambda_streep,float n){
00082
00083
00084
00085
00086
00087 return lambda_streep*n;
00088 }
00089
00090
00091
00092 }