georgebv/pyextremes

How are your confidence intervals calculated?

DamienIrving opened this issue · 3 comments

I was reading through your excellent online documentation and one thing that was missing was a basic description of how your confidence intervals are calculated. I'm assuming this placeholder is where that information will go:
https://github.com/georgebv/pyextremes/blob/master/docs/user-guide/12-confidence-intervals.md

I was wondering if there are plans to complete that documentation page (and the user guide more generally), or is the documentation no longer being actively developed?

@DamienIrving confidence intervals are computed using the Monte Carlo method (for both MLE and MCMC). Documentation takes a lot of time which I currently don't have. I would appreciate any contributions though and would give full credit to the author.

It's really excellent work! While I have the same problem with the confident interval. Can you show me the exact position the confident interval calculated in your code?

@oceanywalker here you go:

  • MLE:
    # Calculate confidence intervals
    rv_sample = self.distribution.distribution.isf(
    ep, *np.transpose(self.fit_parameter_cache[:n_samples])
    )
    cil, ciu = np.quantile(
    a=rv_sample, q=[(1 - alpha) / 2, (1 + alpha) / 2]
    )
  • MCMC:
    # Calculate confidence intervals
    rv_sample = self.distribution.get_prop(
    prop="isf",
    x=ep,
    free_parameters=np.vstack(self.trace[:, burn_in:, :]),
    )
    cil, ciu = np.quantile(
    a=rv_sample, q=[(1 - alpha) / 2, (1 + alpha) / 2]
    )