Estimate Variance Component Parameters
Estimate model parameters for covariates, genetic variance components and residual effect.
estVC(y, x, v = list(E=diag(length(y))), initpar, nit = 25, control = list(), hessian = FALSE)
y |
A numeric vector or a numeric matrix of one column (representing a phenotype for instance). |
x |
A data frame or matrix, representing covariates if not missing. |
v |
A list of matrices representing variance components of interest. Note:
|
initpar |
Optional initial parameter values. |
nit |
Maximum number of iterations for optimization. Ignored if there are not more than two variance components. |
control |
A list of control parameters to be passed to |
hessian |
Logical. Should a numerically differentiated Hessian matrix be returned? |
The optimization function optim is adopted in the above function to estimate the parameters and maximum likelihood. Several optimization methods are available for the optimization algorithm in optim, but we recommend "Nelder-Mead" for the sake of stability. Alternatively, one may choose other options, e.g., "BFGS" to initialize and speed up the estimation procedure and then the procedure will automatically turn to "Nelder-Mead" for final results.
Normality is assumed for the random effects. Input data should be free of missing values.
par |
estimates of the model parameters. |
value |
log-likelihood of the model. |
y |
y used. |
x |
associated with x used. |
v |
variance component matrices v used. |
... |
other information. |
Hessian matrix, if requested, pertains to -log-likelihood function.
data(miscEx) ## Not run: # no sex effect pheno<- pdatF8[!is.na(pdatF8$bwt) & !is.na(pdatF8$sex),] ii<- match(rownames(pheno), rownames(gmF8$AA)) v<- list(A=gmF8$AA[ii,ii], D=gmF8$DD[ii,ii]) o<- estVC(y=pheno$bwt, v=v) o # sex as fixed effect fo<- estVC(y=pheno$bwt, x=pheno$sex, v=v) fo 2*(fo$value-o$value) # log-likelihood test statistic # sex as random effect SM<- rem(~sex, data=pheno) ro<- estVC(y=pheno$bwt, v=c(v,list(Sex=SM$sex))) ro 2*(ro$value-o$value) # log-likelihood test statistic ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.