protected double[] prob(double sample) {
        double p1;
        double[] psample;
        double sum;

        psample = new double[particleCount];
        p1 = -Math.PI * Math.pow(modelVariance, 2);
        for (int i = 0; i < particleCount; i++) {
            psample[i] = modelVariance * Math.pow(Math.E, p1 * Math.pow(particles[1][i] - sample, 2));
        }

        sum = 0.0;
        for (int i = 0; i < particleCount; i++) {
            sum += psample[i];
        }
        if (sum > 0) {
            for (int i = 0; i < particleCount; i++) {
                psample[i] = psample[i] / sum;
            }
        }
        return psample;
    }