Skip to contents

Formula: r = sum (yhat - mean yhat)(y - mean y) / sqrt(sum (yhat - mean yhat)^2 * sum (y - mean y)^2)

Usage

Predacc(y, yhat)

Arguments

y

Numeric vector.

yhat

Predicted values, same length as y.

Value

List with accuracy, r2, n.

References

Montesinos Lopez, Montesinos Lopez and Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, doi:10.1007/978-3-030-89010-0. Chapter 4, Sect. 4.5.1, Eq. (4.1) p. 129 (MSE), Eq. (4.2) p. 129 (Pearson accuracy) and Eq. (4.3) p. 131 (MAE). Read from the chapter PDF, not recalled. Eq. (4.2) is Pearson's correlation between the T test-set predictions and the T observed values; the book calls it the prediction accuracy in plant breeding.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Predacc(V, V)
#> $accuracy
#> [1] 1
#> 
#> $r2
#> [1] 1
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Pearson prediction accuracy, MVSML Eq. (4.2)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"