Skip to contents

Formula: E(y - fhat)^2 = Var(e) + Bias[fhat]^2 + Var(fhat)

Usage

Biasvardec(F, f, sigma2)

Arguments

F

One row per replicate fit, one column per evaluation point: the predictions fhat(x_j) from replicate r.

f

The true f(x_j) at the same n evaluation points.

sigma2

Irreducible error Var(e); must be non-negative.

Value

List with bias2, variance, irreducible, total, bias2_point, variance_point, R, 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.2 p. 113, which reproduces the decomposition of Hastie, Tibshirani and Friedman (2008) p. 223: the expected prediction error under quadratic loss splits into Var(e), the squared bias of fhat and the variance of fhat. Averaged over the evaluation points here. Read from the chapter PDF, not recalled.

Examples

set.seed(1)
F <- matrix(rnorm(50), 5, 10)
f <- rnorm(10)
Biasvardec(F, f, sigma2 = 1)
#> $bias2
#> [1] 1.264337
#> 
#> $variance
#> [1] 0.6399777
#> 
#> $irreducible
#> [1] 1
#> 
#> $total
#> [1] 2.904315
#> 
#> $bias2_point
#>  [1] 0.07227279 0.55825115 0.09180701 2.52469876 1.82734475 5.42413351
#>  [7] 0.16790428 1.54518640 0.29194841 0.13982428
#> 
#> $variance_point
#>  [1] 0.7388774 0.3578714 1.7972997 0.1728444 1.1541057 0.3972616 0.7794009
#>  [8] 0.3851698 0.2713911 0.3455551
#> 
#> $R
#> [1] 5
#> 
#> $n
#> [1] 10
#> 
#> $method
#> [1] "Bias-variance decomposition, MVSML Sect. 4.2"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"