make.dmmobj {dmm} | R Documentation |
dmm
from user-supplied data
Construct an object of class dmm
containing all attributes needed to run the gresponse()
function. The user must supply a phenotypic covariance matrix, and a genetic covariance matrix for each of the components needed by gresponse()
Warning; this function does not currently support class specific genetic parameters.
make.dmmobj(p = NULL, components = c("VarG(Ia)"), ...)
p |
A phenotypic covariance matrix. Dimnames for rows and columns must be set to the trait names |
components |
A character vector specifying names of all of the genetic variance components for which a genetic covariance matrix is to be supplied. If there are genetic covariance components ( eg "CovG(Ia,Ma)"), these must be listed after all the genetic variance components |
... |
A variable number of genetic covariance matrices, one for each of the names listed in the |
Only the minimal attributes for use by the gresponse()
function are constructed. The remainder are set to NULL
An object of class dmm
. Only the following attributes contain data
b |
A dummy set of fixed effects |
siga |
A matrix of genetic variance (and covariance) components set out one component per row and the traitpairs in columns |
variance.components |
A matrix of genetic variance (and covariance) components with the phenotypic covariance matrix appended |
phenotypic.variance |
A matrix of phenotypic covariances set out one trait per row and per column |
If matrices are supplied which are not positive definite, function make.dmmobj()
will alter them to the nearest positive definite matrix using routine neadPD()
from package Matrix
. No message is given. Check the value returned to see if matrices have been adjusted.
Neville Jackson
Functions gresponse()
and dmm()
.
library(dmm)
p <- matrix(c(3,2,2,4),2,2)
dimnames(p) <- list(c("T1","T2"),c("T1","T2"))
gia <- matrix(c(2,1,1,3),2,2)
dimnames(gia) <- dimnames(p)
myobj <- make.dmmobj(p,components=c("VarG(Ia)"),gia)
myresp <- gresponse(myobj,psd=list(dp=c(0.5,0.1)))
print(myresp)
#cleanup
rm(p)
rm(gia)
rm(myobj)
rm(myresp)