Multiple R-Squared
Coefficient of determination
R2(Y, Ypred)
Y
: a real vector with the values of the outputYpred
: a real vector with the predicted values at the same inputswhere is the residual sum of squares
and is the total sum of squares.
Note that the order of the input argument is important.
D. Dupuy
X <- seq(-1,1,0.1) Y <- 3*X + rnorm(length(X),0,0.5) Ypred <- 3*X print(R2(Y,Ypred))
Useful links