svc: Constructor for variance component object

View source: R/svcm_main.R

svcR Documentation

Constructor for variance component object

Description

Creates a variance component object as a function of model objects and (optionally) a relationship matrix.

Usage

svc(form, R = NULL)

Arguments

form

An expression for the covariance model.

R

A relationship matrix. Should be a sparse matrix from the Matrix package.

Value

An object of class svc.

Examples

library(svcm)
R <- Matrix::Diagonal(100)
L <- pm(nrow = 6, ncol = 2,
        labels = paste0("l", 1:12),
        values = c(1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1),
        free = c(FALSE, TRUE, TRUE, FALSE, FALSE, FALSE,
                 FALSE, FALSE, FALSE, FALSE, TRUE, TRUE),
        name = "L")
S <- pm(nrow = 2, ncol = 2,
        labels = c("s11", "s12", "s12", "s22"),
        values = c(2, 1, 1, 2),
        free = TRUE,
        name = "S")
vc <- svc(form = L %*% S %*% t(L), R = R)

espenmei/svcmr documentation built on March 29, 2025, 1:01 p.m.