Learn R Programming

simStateSpace (version 1.2.14)

SimCovN: Simulate Covariance Matrices from the Multivariate Normal Distribution

Description

This function simulates random covariance matrices from the multivariate normal distribution. The function ensures that the generated covariance matrices are positive semi-definite.

Usage

SimCovN(n, sigma, vcov_sigma_vech_l)

Value

Returns a list of random covariance matrices.

Arguments

n

Positive integer. Number of replications.

sigma

Numeric matrix. The covariance matrix (\(\boldsymbol{\Sigma}\)).

vcov_sigma_vech_l

Numeric matrix. Cholesky factorization (t(chol(vcov_sigma_vech))) of the sampling variance-covariance matrix of \(\mathrm{vech} \left( \boldsymbol{\Sigma} \right)\).

Author

Ivan Jacob Agaloos Pesigan

See Also

Other Simulation of State Space Models Data Functions: LinSDE2SSM(), LinSDECovEta(), LinSDECovY(), LinSDEMeanEta(), LinSDEMeanY(), ProjectToHurwitz(), ProjectToStability(), SSMCovEta(), SSMCovY(), SSMMeanEta(), SSMMeanY(), SimAlphaN(), SimBetaN(), SimBetaN2(), SimBetaNCovariate(), SimCovDiagN(), SimIotaN(), SimNuN(), SimPhiN(), SimPhiN2(), SimPhiNCovariate(), SimSSMFixed(), SimSSMIVary(), SimSSMLinGrowth(), SimSSMLinGrowthIVary(), SimSSMLinSDEFixed(), SimSSMLinSDEIVary(), SimSSMOUFixed(), SimSSMOUIVary(), SimSSMVARFixed(), SimSSMVARIVary(), SpectralRadius(), TestPhi(), TestPhiHurwitz(), TestStability(), TestStationarity()

Examples

Run this code
n <- 10
sigma <- matrix(
  data = c(
    1.0, 0.5, 0.3,
    0.5, 1.0, 0.4,
    0.3, 0.4, 1.0
  ),
  nrow = 3
)
vcov_sigma_vech_l <- t(
  chol(
    0.001 * diag(3 * (3 + 1) / 2)
  )
)
SimCovN(
  n = n,
  sigma = sigma,
  vcov_sigma_vech_l = vcov_sigma_vech_l
)

Run the code above in your browser using DataLab