View source: R/Calc CTMparam from VARparam.r
CTMparam | R Documentation |
The continuous-time lagged-effects model matrices corresponding to the discrete-time ones. The interactive web application 'Phi-and-Psi-Plots and Find DeltaT' also contains this functionality, you can find it on my website: https://www.uu.nl/staff/RMKuiper/Websites%20%2F%20Shiny%20apps.
CTMparam(DeltaT, Phi, SigmaVAR = NULL, Gamma = NULL)
DeltaT |
Optional. The time interval used. By default, DeltaT = 1. |
Phi |
(Un)standardized lagged effects matrix. If necessary, it is standardized and for the standardized and vectorized Phi the covariance matrix is determined. It also takes a fitted object from the class "varest" (from the VAR() function in vars package); see example below. From such an object, the Phi and SigmaVAR matrices are extracted. |
SigmaVAR |
Optional (needed to also calculate continuous-time equivalent and to calculate standardized paramater matrices). Residual covariance matrix of the first-order discrete-time vector autoregressive (DT-VAR(1)) model. |
Gamma |
Optional (either SigmaVAR or Gamma). Stationary covariance matrix, that is, the contemporaneous covariance matrix of the data. Note that if Phi and SigmaVAR are known, Gamma can be calculated; hence, either SigmaVAR or Gamma is needed as input. |
The output renders the continuous-time equivalent matrices of the discrete-times ones, together with some checks (namely, the stability of the process and uniqueness of the solution; see the function 'ChecksCTM' for checks on all matrices).
# library(CTmeta)
## Example 1 ##
##################################################################################################
# Input needed in examples below with q=2 variables.
# I will use the example matrix stored in the package:
DeltaT <- 1
Phi <- myPhi[1:2, 1:2]
#
q <- dim(Phi)[1]
SigmaVAR <- diag(q) # for ease
#
Gamma <- Gamma.fromVAR(Phi, SigmaVAR)
##################################################################################################
CTMparam(DeltaT, Phi, SigmaVAR)
# or
CTMparam(DeltaT, Phi, Gamma = Gamma)
## Example 2: input from fitted object of class "varest" ##
#
DeltaT <- 1
data <- myData
if (!require("vars")) install.packages("vars")
library(vars)
out_VAR <- VAR(data, p = 1)
CTMparam(DeltaT, out_VAR)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.