p-values out of cftool fitting result

29 ビュー (過去 30 日間)
Alberto Salinaro
Alberto Salinaro 2015 年 2 月 21 日
回答済み: Greig 2015 年 2 月 22 日
Is it possible to extract/calculate the p-values from the output of a curve fitting session? I used the cftool to fit a surface (matrix of measured data) to find a model of two variables (e.g. time and temperature), to explain the dependency of the data on them. I get a nice fit as I expected. Now I would like to estimate which coefficient has more influence on the measured data, namely if time or temperature. The result is the following:
Linear model Poly22:
ditfit(x,y) = p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2
where x is normalized by mean 200 and std 122.2
and where y is normalized by mean 1213 and std 45.83
Coefficients (with 95% confidence bounds):
p00 = 2.725e+010 (2.466e+010, 2.983e+010)
p10 = -1.337e+010 (-1.487e+010, -1.186e+010)
p01 = -1.437e+010 (-1.588e+010, -1.287e+010)
p20 = 3.03e+009 (1.341e+009, 4.72e+009)
p11 = 5.453e+009 (4.083e+009, 6.822e+009)
p02 = 5.91e+009 (4.22e+009, 7.599e+009)
How can I do that?
Thanks, Alberto S.
P.S. I have MATLAB Version 7.13.0.564 (R2011b)

採用された回答

Greig
Greig 2015 年 2 月 22 日
To extract the coefficients use the "fit" function....
[fitobject,gof,output]=fit([x, y], z, 'poly22');
fitobject.p00, fitobject.p10, etc contain all of the coefficients. For more info type
doc fit
In terms of which coefficient influences the model most, it is better to ask which term influence the model most (e.g., p00, or p10*x, or p01*y, or p20*x^2, etc). Not sure if MATLAB has a specific tool to do this, but a simple approach would be to remove each term one by one and assess the fit. So something like...
coeffs = fieldnames(fitobject);
n=length(coeffs);
for ii=1:n
dummy_fit = fitobject; % copy to dummy variable
dummy_fit.(coeffs{ii}) = 0; % set desired coefficient to zero
zhat = dummy_fit(x, y); % get the model estimate
residual(ii) = norm(z-zhat) % get the residual
end
This loops through all the coefficients and gets the residual when each one is set to zero. Note, that overriding a coefficient value in the fit object spits out a warning, for your purposes this is not important. There may be a smarter way of doing this, but this should work OK.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by