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

The confidence level #40

Open
piotrt75 opened this issue Apr 11, 2020 · 1 comment
Open

The confidence level #40

piotrt75 opened this issue Apr 11, 2020 · 1 comment

Comments

@piotrt75
Copy link

Hi,
Is the 'prediction interval' same as 'confidence level' ? If yes, then is there a way to set it to 95% (k~2) ?
Thanks,
Piotr

@simetenn
Copy link
Owner

Hi Piotr,

The prediction interval and confidence interval are related but not the same. You can find a more detailed explanation here:

https://towardsdatascience.com/how-confidence-and-prediction-intervals-work-4592019576d8

A summary from that article:

"The prediction interval predicts in what range a future individual observation will fall, while a confidence interval shows the likely range of values associated with some statistical parameter of the data, such as the population mean."

Unfortunatly there is no good way of changing from 90 to 95% prediction interval, but it can easily be changed from whithin the Uncertainpy code. You need to look at uncertainpy/src/uncertainpy/core/uncertainty_calculations.py.

If you are using polynomial chaos expansion you change (in the analyse_pce function):

data[feature].percentile_5 = np.percentile(U_mc[feature], 5, -1)
data[feature].percentile_95 = np.percentile(U_mc[feature], 95, -1)

to:

data[feature].percentile_5 = np.percentile(U_mc[feature], 2.5, -1)
data[feature].percentile_95 = np.percentile(U_mc[feature], 97.5, -1)

And if you are using monte carlo you change (in the monte_carlo function):

data[feature].percentile_5 = np.percentile(masked_evaluations, 5,
data[feature].percentile_95 = np.percentile(masked_evaluations, 95, 0)

to:

data[feature].percentile_5 = np.percentile(masked_evaluations, 2.5,
data[feature].percentile_95 = np.percentile(masked_evaluations, 97.5, 0)

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

No branches or pull requests

2 participants