Open mdmurbach opened 6 years ago
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.
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.
Added initial support for confidence intervals in https://github.com/ECSHackWeek/EISfit/commit/398c241819fd70c5a20240749450244a7533a61b
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.
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!