Learn R Programming

simStateSpace (version 1.2.15)

SimBetaN: Simulate Transition Matrices from the Multivariate Normal Distribution

Description

This function simulates random transition matrices from the multivariate normal distribution. The function ensures that the generated transition matrices are stationary using TestStationarity() with a rejection sampling approach.

Usage

SimBetaN(
  n,
  beta,
  vcov_beta_vec_l,
  margin = 1,
  beta_lbound = NULL,
  beta_ubound = NULL,
  bound = FALSE,
  max_iter = 100000L
)

Value

Returns a list of random transition matrices.

Arguments

n

Positive integer. Number of replications.

beta

Numeric matrix. The transition matrix (\(\boldsymbol{\beta}\)).

vcov_beta_vec_l

Numeric matrix. Cholesky factorization (t(chol(vcov_beta_vec))) of the sampling variance-covariance matrix of \(\mathrm{vec} \left( \boldsymbol{\beta} \right)\).

margin

Numeric scalar specifying the stationarity threshold. Values less than 1 indicate stricter stationarity criteria.

beta_lbound

Optional numeric matrix of same dim as beta. Use NA for no lower bound.

beta_ubound

Optional numeric matrix of same dim as beta. Use NA for no upper bound.

bound

Logical; if TRUE, resample until all elements respect bounds (NA bounds ignored).

max_iter

Safety cap on resampling attempts per draw.

Author

Ivan Jacob Agaloos Pesigan

See Also

Other Simulation of State Space Models Data Functions: LinSDE2SSM(), LinSDECovEta(), LinSDECovY(), LinSDEMeanEta(), LinSDEMeanY(), ProjectToHurwitz(), ProjectToStability(), SSMCovEta(), SSMCovY(), SSMInterceptEta(), SSMInterceptY(), SSMMeanEta(), SSMMeanY(), SimAlphaN(), SimBetaN2(), SimBetaNCovariate(), SimCovDiagN(), SimCovN(), 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
beta <- matrix(
  data = c(
    0.7, 0.5, -0.1,
    0.0, 0.6, 0.4,
    0, 0, 0.5
  ),
  nrow = 3
)
vcov_beta_vec_l <- t(chol(0.001 * diag(9)))
SimBetaN(n = n, beta = beta, vcov_beta_vec_l = vcov_beta_vec_l)

Run the code above in your browser using DataLab