'how can I calculate in curve fit the 95% confidence interval from the pcov values?
What are the values I print now with sigma_ab and how can I calculate the confidence interval at 95?
for g in all:
c0 = 5
c2 = 0.2
c3 = 0.7
start = g['y'].iloc[0]
p0 = np.array([c0, c2, c3]), # Construct initial guess array
popt, pcov = curve_fit(
model, g['x'], g['y'],
absolute_sigma=True, maxfev=100000
)
sigma_ab = np.sqrt(np.diagonal(pcov))
n = g.name
print(n+' Estimated parameters: \n', popt)
print(n + ' Approximated errors: \n', sigma_ab)
These are the estimated parameters
[0.24803625 0.06072472 0.46449578]
This is sigma_ab but I don't know exactly what it is. I would like to calculate the upper and lower limit of the mean with 95% confidence interval.
[1.32778766 0.64261562 1.47915215]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
