Coefficient of determination from circular fit to (x,y) data.
古いコメントを表示
Hi everyone,
I'm new to Matlab, but so far, I have used some codes at the File Exchange link which could do the circle fit for a set os measured data points (x,y).
All of them, however, only outputs the center and the radius of the circle.
However, what I also need, is a quantitative evaluation of goodness of fit, and the immediate one I could think of is the R² value (R² = 1 - SSR/SST); where SSR = sum of sq residuals.
Is there any code that could be already written for the calculation of SSR and SST from a set of (x,y) scatter data along with the centre and radius provided by the circle fit? Any other ways to quantify the goodness of fit for a circular regression?
Thanks all.
回答 (1 件)
If the contributors of the FEx submittal(s) you used didn't incorporate such, here's your opportunity to contribute! :)
It'd be pretty simple, just use the parametric form of the equations for a circle given the estimate of origin and radius and compute the fitted x,y values for each observation. The angle is easily obtained from
th=atan2(x,y);
For the estimate of error, you'll probably want to convert these into a distance measure of actual location compared to the fitted; a Euclidean distance would seem as logical a choice as any.
ADDENDUM Actually, I'd expect that'd be what is done in the fitting routine so in all likelihood if you look the residuals are probably already available it you'll modify the routine to return them as an alternate output. You might consider modeling something like the Fitting Toolbox data structure for similarity of implementation.
It's easy in Matlab-speak to compute the sums of squares,
res=y-yhat; % the residual as above
SSE=dot(res,res); % sum of squares
The total SSt should be obvious from the above.
カテゴリ
ヘルプ センター および File Exchange で Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!