next up previous contents index
Next: Index Up: SIM : a C++ Previous: Probability distributions

The analysis class

The complete interface of the analysis class :

   interface analysis 
   {
     analysis(histogram* h); // taking histogram to analyze
     virtual ~analysis();    // destructor
   
     screen* format(char* p,char* options = "");
     screen* format(widget* w,char* p,char* options = "");

     double confidence(char* options = ""); // confidence interval of mean
     double confidence(histogram* h,char* options = ""); // difference

     double covariance(histogram* h2);  // covariance h and h2
     double correlation(histogram* h2); // correlation h and h2
   
     double chisquaretest(double* expected); // chi-square test
   
     double linear();                    // linear fit, return chi-square
     double linear(double a,double b);   
     double quadratic();                 // quadratic fit, return chi-square
     double quadratic(double a,double b,double c);
   
     double uniform();            // uniform fit, return chi-square
     double uniform(double a,double b);     
     double exponential();        // exponential fit, return chi-square
     double exponential(double a);  
     double hyperexponential(double p);  // hyperexponential fit, return chi-square
     double hyperexponential(double p,double a,double b);  
     double gamma();              // gamma fit, return chi-square
     double gamma(double a,double b); 
     double erlang();             // erlang fit, return chi-square
     double erlang(unsigned int n,double a); 
     double binomial();           // binomial fit, return chi-square
     double binomial(double p,unsigned int n);
     double geometric();          // geometric fit, return chi-square
     double geometric(double p);   
     double hypergeometric(unsigned int n); // hypergeometric, return chi-square
     double hypergeometric(unsigned int m,unsigned int n,double p);   
     double negativebinomial();   // neg. binomial fit, return chi-square
     double negativebinomial(double p,unsigned int n);
     double poisson();            // poisson fit, return chi-square
     double poisson(double a);      
     double normal();             // normal fit, return chi-square
     double normal(double a,double b);
     double lognormal();          // lognormal fit, return chi-square
     double lognormal(double a,double b); 
     double chisquare();          // chisquare fit, return chi-square
     double chisquare(unsigned int n);   
     double student();            // students' t fit, return chi-square
     double student(unsigned int n);    
     double fdistribution();      // F distribution fit, return chi-square
     double fdistribution(unsigned int n,unsigned int m); 
     double beta();               // beta fit, return chi-square
     double beta(double a,double b);   
     double weibull();            // weibull fit, return chi-square
     double weibull(double a,double b);
     double triangular();         // triangular fit, return chi-square
     double triangular(double a);  
     double laplace();            // laplace fit, return chi-square
     double laplace(double a); 
   
     int behavior(histogram* h,int n);  // report behavior

     // compare sizes and waiting times for various queues
     int MM1size(double lb,double mu);   
     int MM1waitingtime(double lb,double mu);
     int MMcsize(double lb,double mu,unsigned int c);
     int MMcwaitingtime(double lb,double mu,unsigned int c);
     int MD1size(double lb,double mu);
     int MD1waitingtime(double lb,double mu);

     void postscript(char* fn);   // generate postscript
   };
fig C.1. The interface of the class analysis

Notice that the hypergeometric fit in both cases requires the n value. This value represents the number of items drawn from the population and therefore should be known. The hyperexponential fit always takes the chance of the first exponential distribution.



D Bolier
Fri Sep 8 15:07:53 MET DST 1995