public static double norm_rmse(double[] obs, double[] sim, double missing) {
        double sum = 0, size = 0;
        for (int i = 0; i < obs.length; i++) {
            if (obs[i] > missing) {
                sum += obs[i];
                size++;
            }
        }

        double measuredMean = sum / size;
        int N = Math.min(obs.length, sim.length);
        double numerator = 0, denominator = 0;
        for (int i = 0; i < N; i++) {
            if (obs[i] > missing) {
                numerator += (obs[i] - sim[i]) * (obs[i] - sim[i]);
                denominator += (obs[i] - measuredMean) * (obs[i] - measuredMean);
            }
        }
        if (denominator == 0) {
            throw new RuntimeException("Error: The denominator is 0.\n"
                    + "This happens if all observed values are equal to their mean.");
        }
        return Math.sqrt(numerator / denominator);
    }