confint and predint bounds trouble

19 次查看(过去 30 天)
Hi, I'm having trouble understanding how confint and predint work. I thought that since predint takes into account the uncertanty of a predicted measurement, the predint bounds would be broader than the confint bounds (for the same confidence level, i.e. 95%). But whenever I fit simple data and I draw the confint bounds I find them broader than the predint bounds (for any type of bounds.). So what is it that I'm missing out?

采纳的回答

Tom Lane
Tom Lane 2012-5-31
CONFINT returns confidence intervals for the parameters. So if you fit y=a+b*x, you get confidence intervals for a and b.
PREDINT returns confidence intervals for predicted values. So if you supply x values x1,x2,x3, you get confidence intervals for the three quantities a+b*x1, a+b*x2, and a+b*x3.
There are options that allow PREDINT to produce either of the two things you describe in your question. You can use those options to get confidence intervals for either the curve at x=x2, or a new observation y2 taken at x=x2.
  3 个评论
Tom Lane
Tom Lane 2012-6-1
The variance of a*X+b is var(a)*x^2+var(b)+2*x*cov(a,b). So variances add if you take the covariances into account. You have tried to add confidence interval widths, which is kind of like trying to add standard deviations, and that doesn't work.
As for the other question, suppose the function is f(x). Suppose a new observation is ynew=f(xnew)+errornew. There are PREDINT options to control if you want the interval to provide 95% confidence for either f(xnew) or f(xnew)+errornew.
Juan Conde
Juan Conde 2012-6-5
I knew I was doing something wrong, I just didn't know what it was.
Thank you very much Tom!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fit Postprocessing 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by