I want to ask you a problem that I have. I make a non linear fit with some data, and I want to know how can I put the error bars in the plot together with the confidence level of the fit that I perform. I have tried this but doesn't work:
data = {{0, 1}, {1, 0}, {3, 2}, {5, 4}, {6, 4}, {7, 5}};
errors = {0.1, 0.1, 0.2, 0.05, 0.2, 0.15};
nlm = NonlinearModelFit[data, Log[a + b x^2], {a, b}, x,
Weights -> 1/errors^2, VarianceEstimatorFunction -> (1 &)];
{bands80[x_], bands90[x_], bands95[x_], bands99[x_]} =
Table[nlm["SinglePredictionBands",
ConfidenceLevel -> cl], {cl, {0.6, .9, .95, 0.99}}];
Show[Plot[{nlm[x], bands80[x], bands90[x], bands95[x],
bands99[x]}, {x, 0, 7},
Filling -> {2 -> {1}, 3 -> {2}, 4 -> {3}, 5 -> {4}}],
Graphics[{PointSize[Large], Blue, Point[data]}]]
I have though that maybe using ErrorListPlot[withError, PlotStyle -> Red]
, could work, but it doesn't...Do you know how to do it? Thanks