package lehre; import java.util.*; import java.io.*; public class RS_Blatt3 { static Random r = new Random(); // Erzeugt eine mit Parameter lambda Poisson-verteilte ZV // als Summe von Exp-verteilten ZV public static int poisson(double lambda) { int count = 0; double e = -Math.log(r.nextDouble()); while (e <= lambda) { count++; e -= Math.log(r.nextDouble()); } return count; } // Erzeugt eine Realisierung eines Poisson-Prozesses mit Intensitaetsfunktion f // im Fenster (x_axis[0],x_axis[1]) X (y_axis[0], y_axis[1]) public static Vector PoissonProcess(double[] x_axis, double[] y_axis, intensityFunction f) { Vector points = new Vector(); double x_length = x_axis[1] - x_axis[0]; double y_length = y_axis[1] - y_axis[0]; // Bestimme Anzahl der Punkte int number_of_points = poisson(f.max()*x_length*y_length); for(int i=0; i95) rejections[k]++; } // End for k } // End for mc_test; for(int k=0; k