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

Add confidence intervals to parameter estimates #4

Open
mdmurbach opened this issue May 18, 2018 · 3 comments
Open

Add confidence intervals to parameter estimates #4

mdmurbach opened this issue May 18, 2018 · 3 comments

Comments

@mdmurbach
Copy link
Member

We should return confidence intervals on our parameter fits (probably as a model.confidence_ attribute). The standard deviation can be calculated by taking the square root of the diagonal elements in the covariance matrix that is returned by leastsq (np.sqrt(np.diag(pcov)).

It would also be awesome if the predict method could predict the upper and lower confidence interval ranges too!

@nealde
Copy link
Collaborator

nealde commented May 19, 2018

We should directly add them to the plot as well. Maybe we can render a nice seaborn image as an object where getting the attribute will return the plot, or give the object a plot function with nice defaults.

@mdmurbach
Copy link
Member Author

I like the idea of trying to add some plotting. I've got the formatted matplotlib figure from the tutorials leading up to Hack Week. I also think it'd be cool to generate altair Nyquist plots that have tooltips.

@mdmurbach
Copy link
Member Author

Added initial support for confidence intervals in 398c241

Right now it basically takes N=1000 uniform samples over the +/- 2std. parameter space and calculates the min and max bounds for the resulting impedance.

I also added a plotting method (see plottingExample.ipynb) since I agree that this is the most natural venue to think about confidence intervals. Definitely still rough around the edges and we could use to open more of the plotting, CI calculation variables, etc. as optional parameters, but I think we're headed in the right direction.

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