對於m個樣本blog
某模型的估計值爲io
計算樣本的總平方和TSS(Total Sum of Squares):im
計算殘差平方和RSS(Residual Sum of Squares):d3
RSS即偏差平方和SSE(Sum of Squares for Error)db
定義 R2=1-RSS/TSSimg
R2越大,擬合效果越好co
R2的最優值爲1360
若預測值恆爲樣本指望,R2爲0d3
亦可定義ESS(Explained Sum of Squares):ps
TSS=ESS+RSS
只有在無偏估計時上述等式才成立,不然,TSS≥ESS+RSS
ESS又稱迴歸平方和SSR(Sum of Squares for Regression)