Fit: how to return chi-squared instead of r-squared

Hi, i'm performing this fit:
f=fittype('a*(x^(-b))*exp(-x/c)');
options = fitoptions('Method','NonlinearLeastSquares','StartPoint',[100,1,1]);
[val1,val2,val3]=fit(x,y,f,options);
disp(val2);
and I get on the screen
sse: 9.7986e-04
rsquare: 1.0000
dfe: 97
adjrsquare: 1.0000
rmse: 0.0032
How could I get chi-square instead of r-square?

답변 (1개)

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014년 1월 22일

1 개 추천

The Curve Fitting Toolbox only supports these goodness-of-fit statistics for parametric models:
If you want the chi-squared statistic, you will have to write your own code from your input data and your calculated fit.

카테고리

도움말 센터File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

질문:

2014년 1월 22일

답변:

2014년 1월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by