'calculate quantiles of Monte Carlo results
similar to ppf
Parameters
idx : None or list of integers
List of indices into the Monte Carlo results (columns) that should
be used in the calculation
frac : array_like, float
Defines which quantiles should be calculated. For example a frac
of 0.1 finds the 10% quantile, x such that cdf(x)=0.1
Returns
frac : ndarray
same values as input, TODO: I should drop this again ?
quantiles : ndarray, (len(frac), len(idx))
the quantiles with frac in rows and idx variables in columns
Notes
rename to ppf ? make frac required
change sequence idx, frac'

def quantiles(self, idx=None, frac=[0.01, 0.025, 0.05, 0.1, 0.975]):

    if (self.mcres.ndim == 2):
        if (not (idx is None)):
            mcres = self.mcres[:, idx]
        else:
            raise ValueError('currently    only    1    statistic    at    a    time')
    else:
        mcres = self.mcres
    self.frac = frac = np.asarray(frac)
    mc_sorted = self.get_mc_sorted()[:, idx]
    return (frac, mc_sorted[(self.nrepl * frac).astype(int)])
