I want to assign the various values returned from fit (cf_) to variables. How do I access the 95% confidence bounds?
e.g.
[cf_, G] = fit(X,Y, etc.);
A = cf_.a; B = cf_.b; etc.
but ? = cf_.a confidence bound.
thanks
kip

답변 (1개)

John D'Errico
John D'Errico 2020년 10월 6일

0 개 추천

Easy enough. Consider the simple model:
x = rand(10,1);
y = rand(10,1);
mdl = fit(x,y,'poly1')
mdl =
Linear model Poly1: mdl(x) = p1*x + p2 Coefficients (with 95% confidence bounds): p1 = 0.4538 (-0.566, 1.474) p2 = 0.2819 (-0.3075, 0.8712)
confint(mdl)
ans = 2×2
-0.5660 -0.3075 1.4737 0.8712
So as you see, confint produces confidence intervals on the parameters.
If you wanted confidence intervals on a predicted point, here, at x == 0.25...
predint(mdl,0.25)
ans = 1×2
-0.3569 1.1476

카테고리

도움말 센터File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

질문:

Kip
2011년 6월 16일

답변:

2020년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by