필터 지우기
필터 지우기

Programmatically calculate goodness of fit using Curve Fitting Toolbox?

조회 수: 1 (최근 30일)
Tim
Tim 2014년 2월 8일
댓글: Tim 2014년 2월 10일
Hi,
I am hoping to retrieve the goodness of fit values that the curve fit tool calculates for a custom model, but programatically. My model is:
g=fittype('a*sin(2*pi*25000000*x+b)+c')
which I fit to x and y data with:
f=fit(x,v,g)
(where v is for voltage). This returns the following:
f =
General model:
f(x) = a*sin(2*pi*25000000*x+b)+c
Coefficients (with 95% confidence bounds):
a = -13.03 (-13.04, -13.02)
b = -4.746 (-4.747, -4.745)
c = -0.3985 (-0.4073, -0.3897)
From here I want to see the sum of squares due to error (SSE), R-square, Adjusted R-square, and Root Mean Square Error (RMSE), as a quantitative assessment of the model quality. Does anyone have any solutions? There is no obvious way of retrieving this information listed in the documentation for the toolbox.
Thanks in advance.

채택된 답변

Matt J
Matt J 2014년 2월 8일
The FIT command returns goodness of fit info as its second output argument, as documented here

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by