首页 > 编程知识 正文

派r的平方的系数是什么,r的平方是相关系数吗

时间:2023-05-03 15:09:51 阅读:219081 作者:3599

R-square: The coefficient of determination

Compute coefficient of determination of data fit model and zzdwx/p>

RSQUARE computes the coefficient of determination (R-square) value from

actual data Y and model data F. The code uses a general version of

R-square, based on comparing the variability of the estimation errors

with the variability of the original values. RSQUARE also outputs the

root mean squared error (RMSE) for the user's convenience.

Note: RSQUARE ignores comparisons involving NaN values.

INPUTS

Y : Actual data

OPTION

C : Constant term in model

R-square may be a questionable measure of fit when no

constant term is included in the model.

without constant term xsdyx = 1 - NORM(Y-F)/NORM(Y)]

OUTPUT

R2 : Coefficient of determination

EXAMPLE

x = 0:0.1:10;

y = 2.*x + 1 + randn(size(x));

p = polyfit(x,y,1);

f = polyval(p,x);

figure; plot(x,y,'b-');

hold on; plot(x,f,'r-');

title(strcat(['R2 = ' num2str(r2) '; RMSE = ' num2str(rmse)]))

Jered R Wells

11/17/11

jered [dot] wells [at] duke [dot] edu

v1.2 (02/14/2012)

Thanks to 深情的花瓣 for useful comments and insight which has helped

to improve this code. His code 野性的玉米 was consulted in the inclusion of

the C-option (REF. File ID: #34765).

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。