Gamma.fromCTM: Calculate the stationary covariance matrix Gamma

View source: R/Calc Gamma.r

Gamma.fromCTMR Documentation

Calculate the stationary covariance matrix Gamma

Description

Calculates the stationary covariance matrix (Gamma) from the continuous-time (un)standardized lagged effects matrix (Drift) and residual covariance matrix (Sigma). There is also an interactive web application on my website: Standardizing and/or transforming lagged regression estimates (https://www.uu.nl/staff/RMKuiper/Websites%20%2F%20Shiny%20apps).

Usage

Gamma.fromCTM(Drift, Sigma)

Arguments

Drift

(Un)standardized lagged effects matrix of the first-order continuous-time (CT-VAR(1)) model. It also takes a fitted object from the class "ctsemFit" (from the ctFit() function in the ctsem package); see example below. From such an object, the Drift and Sigma matrices are extracted.

Sigma

Residual covariance matrix of the first-order continuous-time (CT-VAR(1)) model, that is, the diffusion matrix.

Value

This function returns the stationary covariance matrix, that is, the contemporaneous covariance matrix of the data.

Examples


# library(CTmeta)

## Example 1 ##
#
Drift <- myDrift
#
q <- dim(Drift)[1]
Sigma <- diag(q) # for ease
#
Gamma.fromCTM(Drift, Sigma)


## Example 2: input from fitted object of class "ctsemFit" ##
#
#data <- myData
#if (!require("ctsemFit")) install.packages("ctsemFit")
#library(ctsemFit)
#out_CTM <- ctFit(...)
#Gamma.fromCTM(out_CTM)


rebeccakuiper/CTmeta documentation built on Oct. 17, 2023, 7:01 a.m.