P-value from nlinfit

4 次查看(过去 30 天)
Morten
Morten 2012-1-30
Hi
I'm using nlinfit to create an exponential fit in a correlation analysis. I would like to obtain the probability estimate of the model fit (or P-value). Can I find this in the covariance matrix? If so, in which index?
Best Morten

采纳的回答

Tom Lane
Tom Lane 2012-1-30
For a function like
f = @(b,x) b(1) + b(2)*x.^b(3);
you might be interested in the p-value for a test of whether coefficients 2 and 3 could be zero. That tests whether this fit is significantly better than a horizontal (constant) line. Here's how you could do that:
[b,~,~,covb] = nlinfit(x,y,f,[1 1 1]);
p = linhyptest(b(2:3),covb(2:3,2:3));
There are other arguments you can supply to linhyptest to further specify the hypothesis. Also, it's more accurate to supply the dfe argument; what I did results in a normal rather than t test.
  2 个评论
Morten
Morten 2012-1-31
Perfect. Thanks.
However, in my case it would be even better to test the exponential fit (below) against a linear regression.
f = @(b,x)(b(1) + b(2)*exp(-b(3)*x))
Is that possible?
Tom Lane
Tom Lane 2012-1-31
There's not a formal way that I know about to do that test. The usual thing is to test two models where one is a special case of the other. In both your model and mine, the horizontal line is a special case of the three-parameter fit.
More informally, people do use AIC to compare models that are not nested one inside the other.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Hypothesis Tests 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by