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

Confidence intervals #1656

Closed
wants to merge 1 commit into from
Closed

Confidence intervals #1656

wants to merge 1 commit into from

Conversation

aulemahal
Copy link
Collaborator

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGES.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • New confidence argument on stats function that perform a fit.
  • Enable interval as a dist method in dist_method.

Does this PR introduce a breaking change?

No, the default behaviour is unchanged.

Other information:

from xclim.testing import open_dataset
import xclim as xc

ds = open_dataset('sdba/CanESM2_1950-2100.nc')
params, confint = xc.indices.stats.fit(ds.pr, 'gamma', confidence=0.95)

@aulemahal aulemahal requested a review from huard February 19, 2024 19:57
Copy link
Collaborator

@huard huard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, I don't think this is exactly what we want. The scipy interval function only returns the bounds a, b such that, with the given parameters, confidence % of samples will be within [a,b]. This is not an indication of the quality of fit.

I'll do some research to clarify the request here.

@@ -90,13 +91,19 @@ def fit(
The PWM method is usually more robust to outliers.
dim : str
The dimension upon which to perform the indexing (default: "time").
confidence : float, optional
If set, the interval for the corresponding confidence is returned along the parameters.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If set, the interval for the corresponding confidence is returned along the parameters.
If set, the interval for the corresponding confidence is returned along with the parameters.

@Zeitsperre
Copy link
Collaborator

False track. Closing.

@Zeitsperre Zeitsperre closed this Mar 12, 2024
@aulemahal aulemahal deleted the confidence-interval branch May 6, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confidence intervals on statistical functions
3 participants