Skip to contents

Fitting a model

One engine; the formula terms choose the model.

model()
Fit a mixed model by AI-REML
model_mt()
Fits a multi-trait mixed model by AI-REML
gibbs()
Gibbs sampler for a single-trait mixed model
half_t()
Half-t prior for the variances of gibbs()

Breeding values and genetic parameters

solutions()
Breeding values, their standard error and accuracy, in one table
ebv()
Genetic values of a group
accuracy()
Accuracy of the genetic values
coef(<breeding_fit>)
Coefficients of a fit: variance components or fixed-effect solutions
h2()
Heritability from the estimated components
rg()
Genetic correlation between two traits, from the multi-trait fit
h2_curve()
Heritability along the gradient, for a reaction-norm fit
h2_observed()
Heritability on the observed scale from the liability scale
h2_liability()
Heritability on the liability scale from the observed scale
se_function()
Standard error of a function of the variance components (delta method)
profile_theta()
Profile likelihood for one variance component

Diagnostics

Residuals of a fit and convergence of a chain.

residuals(<breeding_fit>) fitted(<breeding_fit>) residuals(<breeding_fit_mt>) fitted(<breeding_fit_mt>) residuals(<breeding_gibbs>) fitted(<breeding_gibbs>)
Residuals and fitted values of a mixed-model fit
mcmc_diagnostics()
MCMC convergence diagnostics
as_draws_array(<breeding_gibbs>) as_draws(<breeding_gibbs>) as.mcmc.list(<breeding_gibbs>)
Convert the chains of a gibbs() fit to posterior or coda draws
ess()
Effective sample size by the initial monotone sequence estimator
rhat()
Rank-normalized split R-hat
geweke_z()
Geweke convergence z-score

Pedigree and relationship matrices

pedigree()
Sort a pedigree and compute inbreeding
sire_mgs()
Declare a pedigree of sires and maternal grandsires
a_inverse()
Inverse of the relationship matrix, by Henderson
a22_inverse()
Inverse of A22 by the sparse Schur complement
estimate_gamma()
Estimate the relationships among metafounders from genotypes

Genomics

Relationship matrices from markers and the single step.

g_matrix()
Genomic relationship matrix (VanRaden)
h_inverse()
Inverse of the single-step relationship matrix H
apy_inverse()
Inverse of G by the APY algorithm
apy_core_select()
Choose the APY core by the eigenvalues of G
snp_blup()
Single-step SNP-BLUP: markers as equations, no G, conjugate gradients
snp_effects()
Backsolve SNP effects from a single-step fit
pegs()
Multi-trait genomic prediction by randomized Gauss-Seidel (PEGS)

Data and quality control

read_plink()
Read PLINK genotypes into the genotypes= shape
read_blupf90_snp()
Read a BLUPF90 genotype file into the genotypes= shape
qc_phenotypes()
Phenotype quality control
qc_genotypes()
Genotype quality control
parentage_check()
Parent-offspring conflicts between the genotypes and the pedigree

Environment and reaction norms

legendre()
Normalized Legendre polynomials, evaluated on a gradient
thi()
Temperature-humidity index (NRC 1971)
heat_load()
Heat load above a threshold

Selection decisions

selection_index()
Economic selection index over EBVs
rank_drift()
Ranking drift between two evaluations

Simulation

simulate_breeding()
Simulate a small breeding population

Sparse linear algebra and the engine

sparse_chol()
Sparse Cholesky of a symmetric positive-definite matrix
sparse_solve()
Solve A x = b with A sparse symmetric positive-definite
selected_inverse()
Takahashi selective inverse
inv_pd()
Inverse of a symmetric positive-definite matrix, by block Cholesky
br_threads()
Number of threads for the parallel parts of the engine
br_version()
Package version

Internal evaluations for the validation gates

Exported so that the tests can compare the two routes of the likelihood.

eval_internal()
Evaluate -2logL, score and AI at a given theta, by both routes
eval_internal_mt()
Internal multi-trait evaluation, for the gates