This function constructs and fits an OpenMx model for a pedigree using specified variance components and family group models.
Usage
fitPedigreeModel(
model_name = "PedigreeModel",
vars = list(ad2 = 0.5, dd2 = 0.3, cn2 = 0.2, ce2 = 0.4, mt2 = 0.1, am2 = 0.25, ee2 =
0.6),
data = NULL,
group_models = NULL,
Addmat = NULL,
Nucmat = NULL,
Extmat = NULL,
Mtdmat = NULL,
Amimat = NULL,
Dmgmat = NULL,
tryhard = TRUE,
intervals = TRUE,
extraTries = 10,
condenseMatrixSlots = TRUE
)Arguments
- model_name
Character. Name for the overall OpenMx model. Default is "PedigreeModel".
- vars
A named list or vector of initial variance component values.
- data
A matrix or data frame of observed data, where each row is a family and columns correspond to individuals. Only used when
group_modelsis NULL.- group_models
Optional list of pre-built OpenMx family group models (from
buildOneFamilyGroup). If NULL, they are generated fromdatausing the provided relatedness matrices.- Addmat
Additive genetic relatedness matrix (from
ped2add).- Nucmat
Nuclear family shared environment relatedness matrix (from
ped2cn).- Extmat
Common extended family environment relatedness matrix. When non-NULL, a Vce term scaled by this matrix is added to the covariance. If a non-matrix value (e.g.
TRUE) is supplied, a unit matrix (all members share equally) is created automatically.- Mtdmat
Mitochondrial genetic relatedness matrix (from
ped2mit).- Amimat
Additive by mitochondrial interaction relatedness matrix.
- Dmgmat
Dominance genetic relatedness matrix.
- tryhard
Logical. If TRUE (default), use
mxTryHardfor robust optimization; if FALSE, usemxRun.- intervals
Logical. If TRUE (default), compute confidence intervals for the parameters using
mxSEandmxCI.- extraTries
Numeric. The number of extra optimization attempts to make when
tryhardis TRUE. Default is 10.- condenseMatrixSlots
Logical. If TRUE, use the mxCondenseMatrixSlots wrapper to optimize memory usage for large matrices. Default is TRUE.