Compute Genomic Prediction Accuracy and Bias

Compute Genomic Prediction Accuracy and Bias

Description

Evaluates prediction accuracy and bias of genomic estimated breeding values (GEBV) against observed phenotypes. Returns three metrics commonly used.

Usage

compute_accuracy(gebv, y, h2 = NULL)

Arguments

gebv numeric vector of genomic estimated breeding values, typically fit$total_gebv from a masreml() or gwablup() object.
y numeric vector of observed phenotypes (same length as gebv).
h2 numeric, heritability estimate for computing the marker-genetic correlation (r_MG). If NULL, r_MG is returned as NA. Typically fit$varcomp$h2 from the fitted model.

Value

data.frame with columns:

  • r: Pearson correlation between GEBV and phenotype. Ranges from -1 to 1; higher is better.

  • slope: regression coefficient of phenotype on GEBV (lm(y ~ gebv)). Value of 1 indicates unbiased prediction; < 1 indicates inflation; > 1 indicates deflation.

  • r_MG: marker-genetic correlation, computed as r / sqrt(h2). Approximates correlation between GEBV and true breeding value.

See Also

masreml, gwablup, cv_masreml

Examples

library("masreml")

fit <- masreml(y, markers = list(snp_add = W))

acc <- compute_accuracy(
  gebv = fit$total_gebv,
  y    = y,
  h2   = fit$varcomp$h2["snp_add"]
)
print(acc)
#      r  slope   r_MG
# 0.823  0.991  0.914