Plotting one standard deviation from a curve fit when one optimised value is negative?

80 Views Asked by At

I wasn't sure whether to ask this on a math site or SO since it's related to SciPy and Matplotlib. But I think my question is more mathematical than anything.

I fit a second-order polynomial ($a + b x + c x^2$) to a handful of data points. I want to graph the reported standard deviation from SciPy's curve_fit on my plot. The thing is, one of the optimised parameters ($b$) is negative. Should I plot the error curves by adding the standard deviation blindly, or should I subtract when it comes to the negative value?

First case: top line is $(a + \delta a) + (b + \delta b) x + (c + \delta c) x^2$, where $b < 0$: a

Second case: top line is $(a + \delta a) + (b - \delta b) x + (c + \delta c) x^2$, where $b < 0$: b