function [obs_crps] = f_CRPS_nrg(preds,y)
    % preds needs to be row vector
    abserr   = mean(abs(preds-y));
    [a,~]    = sort(preds);
    diff     = a(2:end)-a(1:end-1);
    weight   = (1:length(preds)-1).*(length(preds)-1:-1:1);
    obs_crps = abserr -  sum(diff.*weight)/length(preds)^2;
end

