2 * 17 June 1997 (see notebook)
19 main(int argc, char **argv)
21 int n; /* number of EVD samples */
23 struct histogram_s *histog;
27 int do_evd, set, fit_evd, show_hist;
29 p1 = atof(argv[1]); /* mu or mean */
30 p2 = atof(argv[2]); /* lambda or sd */
31 n = atoi(argv[3]); /* # of histograms */
32 do_evd = atoi(argv[4]); /* 1 to sample EVD; 0 to sample Gaussian */
33 set = atoi(argv[5]); /* 1 to set instead of fit the dist */
34 fit_evd = atoi(argv[6]); /* 1 to fit EVD; 0 to fit Gaussian */
35 show_hist = atoi(argv[7]); /* 1 to show histogram */
37 seed = (int) time ((time_t *) NULL);
40 for (j = 0; j < n; j++)
42 histog = AllocHistogram(-200, 200, 100);
43 for (i = 0; i < 2500; i++)
45 if (do_evd) x = EVDrandom(p1, p2);
46 else x = Gaussrandom(p1, p2);
50 AddToHistogram(histog, x);
54 ExtremeValueSetHistogram(histog, p1, p2);
55 else if (set && !fit_evd)
56 GaussianSetHistogram(histog, p1, p2);
57 else if (!set && fit_evd)
58 ExtremeValueFitHistogram(histog, 9999.);
60 GaussianFitHistogram(histog, 9999.);
62 printf("%f\n", histog->chip);
65 PrintASCIIHistogram(stdout, histog);
67 FreeHistogram(histog);