public Point[] drawRandomPoints(int m) {
        Point[] points = new Point[m];
        double[] f = new double[this.components];
        double sum = 0.0;
        for (int i = 0; i < this.components; i++) {
            sum = sum + this.weights[i];
            f[i] = sum;
        }
        for (int i = 0; i < m; i++) {
            double r = Math.random();
            int idx = 0;
            while (f[idx] < r && idx < this.components - 1) {
                idx++;
            }
            points[i] = drawRandomPointFromGaussian(params[idx]);
        }
        return points;
    }