R2 {DiceEval} | R Documentation |
Multiple R-Squared
Description
Coefficient of determination R^{2}
Usage
R2(Y, Ypred)
Arguments
Y |
a real vector with the values of the output |
Ypred |
a real vector with the predicted values at the same inputs |
Value
\code{R2}= 1 - \frac{SSE}{SST}
where SSE= \sum_{i=1}^{n} (Y(x_{i}) - \hat{Y}(x_{i})^{2}
is the residual sum of squares
and SST= \sum_{i=1}^{n} (Y(x_{i}) - \bar{Y} )^{2}
is the total sum of squares.
Note that the order of the input argument is important.
Author(s)
D. Dupuy
Examples
X <- seq(-1,1,0.1)
Y <- 3*X + rnorm(length(X),0,0.5)
Ypred <- 3*X
print(R2(Y,Ypred))
[Package DiceEval version 1.6.1 Index]