y
|
numeric vector of phenotypes (length n). Named vector recommended for ID alignment. For binary trait, must contain only 0 and 1.
|
X
|
fixed effects design matrix (n x c). If NULL, intercept only is used.
|
markers
|
list of raw marker inputs (optional):
-
snp_add: matrix (n x m), raw genotype 0/1/2
-
snp_dom: matrix (n x m), raw genotype 0/1/2
-
mh_add: list of data.frames, one per chromosome. First column = individual ID, remaining columns = paired haplotype allele codes per block (strand1, strand2, strand1, …)
|
G
|
list of pre-built relationship matrices (optional):
-
snp_add: numeric matrix (n x n), SNP additive G
-
snp_dom: numeric matrix (n x n), SNP dominance D
-
mh_add: numeric matrix (n x n), multi-allelic additive Agh
-
pedigree: numeric matrix (n x n), pedigree A
|
method
|
character, REML algorithm for variance component estimation:
-
“auto” (default): AI-REML for continuous, HE regression for binary
-
“HE”: Haseman-Elston regression (fast, one-step)
-
“AI”: Average Information REML (accurate, iterative)
-
“EM”: Expectation-Maximization REML (stable, slower)
-
“HI”: HE-initialized AI-REML
For binary trait, “HE” is recommended for speed. Any method can be used but “AI” may be slow on working response.
|
solver
|
character, EBV solver:
-
“auto” (default): Cholesky for n < 10,000, PCG otherwise
-
“cholesky”: direct Cholesky factorization
-
“pcg”: preconditioned conjugate gradient (large n)
|
max_iter
|
integer, maximum REML iterations (default 100)
|
tol
|
numeric, convergence tolerance (default 1e-6)
|
n_threads
|
integer, number of threads (default: all physical cores)
|
trait
|
character, trait distribution:
-
“continuous” (default): Gaussian REML-BLUP
-
“binary”: 0/1 phenotype, single-step Laplace approximation on liability scale
|
link
|
character, link function for binary trait:
-
“logit” (default): logistic link, sigma2_e = pi^2/3
-
“probit”: probit link, sigma2_e = 1
|
verbose
|
logical, if TRUE (default) prints a brief post-fit summary banner (algorithm, runtime, convergence, variance components, h2, GEBV summary) when masreml() returns. The existing progress messages (“Building…”, “Running REML…”, “Solving EBV…”) are unaffected by this flag.
|
save_rds
|
logical, if TRUE the fit is also written to disk as an RDS file. Default FALSE (differs from masbayes::run_bayesr()) because masreml() is often called inside cv_masreml loops where auto-saving would clobber per-fold output. Set to TRUE for one-off full-data fits you want to persist.
|
save_path
|
optional explicit RDS path. If NULL (default), defaults to “results_masreml.Rds” in the current working directory. Ignored unless save_rds = TRUE.
|