Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How are your confidence intervals calculated? #36

Closed
DamienIrving opened this issue Sep 6, 2022 · 3 comments
Closed

How are your confidence intervals calculated? #36

DamienIrving opened this issue Sep 6, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@DamienIrving
Copy link

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 DamienIrving added the enhancement New feature or request label Sep 6, 2022
@georgebv
Copy link
Owner

@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.

@oceanywalker
Copy link

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?

@georgebv
Copy link
Owner

@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]
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants