Simple function to calculate the r square of a dataset y (vector or matrix form) and the corresponding estimates yhat calculated using a regression.
Uses r2 = 1 - SSe/SSt
Input can contain NaNs.
it works, thanks for sharing !!!
Thank you Felix Hebeler and
Petteri T for your work and suggestions.
Thanks for sharing!
Works fine!!! Thanx ;)
sum( (y-yhat).^2) could be replaced with (y-what)' * (y-what) for speedup as suggested there: http://www.mathworks.nl/matlabcentral/newsreader/view_thread/168821
Does the job.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.