Filter löschen
Filter löschen

Programmatically calculate goodness of fit using Curve Fitting Toolbox?

1 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

Matt J
Matt J am 8 Feb. 2014
The FIT command returns goodness of fit info as its second output argument, as documented here

Weitere Antworten (0)

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by