Skip to contents

This function simulates random drift matrices from the multivariate normal distribution. The function ensures that the generated drift matrices are stable using TestPhi().

Usage

SimPhiN(n, phi, vcov_phi_vec_l)

Arguments

n

Positive integer. Number of replications.

phi

Numeric matrix. The drift matrix (\(\boldsymbol{\Phi}\)).

vcov_phi_vec_l

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

Author

Ivan Jacob Agaloos Pesigan

Examples

n <- 10
phi <- matrix(
  data = c(
    -0.357, 0.771, -0.450,
    0.0, -0.511, 0.729,
    0, 0, -0.693
  ),
  nrow = 3
)
vcov_phi_vec_l <- t(chol(0.001 * diag(9)))
SimPhiN(n = n, phi = phi, vcov_phi_vec_l = vcov_phi_vec_l)
#> [[1]]
#>            [,1]          [,2]        [,3]
#> [1,] -0.3448957  2.089554e-06  0.03616728
#> [2,]  0.7926950 -5.310285e-01  0.05736071
#> [3,] -0.4445841  7.680411e-01 -0.65809866
#> 
#> [[2]]
#>            [,1]        [,2]         [,3]
#> [1,] -0.3623718 -0.01217511 -0.007735489
#> [2,]  0.7801082 -0.52698944 -0.006206552
#> [3,] -0.4322138  0.77339135 -0.723781543
#> 
#> [[3]]
#>            [,1]       [,2]        [,3]
#> [1,] -0.3109196 -0.0344481  0.01618050
#> [2,]  0.8388004 -0.4985958 -0.04549078
#> [3,] -0.4247055  0.6926874 -0.67053191
#> 
#> [[4]]
#>            [,1]        [,2]         [,3]
#> [1,] -0.3345771 -0.06306017 -0.002279254
#> [2,]  0.7431753 -0.49728195  0.026453144
#> [3,] -0.4665079  0.67926889 -0.665562726
#> 
#> [[5]]
#>            [,1]        [,2]        [,3]
#> [1,] -0.3349482  0.03249946 -0.01232484
#> [2,]  0.7412043 -0.49434942  0.04992734
#> [3,] -0.4805185  0.71712133 -0.63865777
#> 
#> [[6]]
#>            [,1]        [,2]        [,3]
#> [1,] -0.3824591 -0.01985415  0.01570994
#> [2,]  0.8117500 -0.51413047 -0.02832438
#> [3,] -0.4421361  0.67692962 -0.68330201
#> 
#> [[7]]
#>            [,1]         [,2]        [,3]
#> [1,] -0.3663760  0.005225181 -0.02010547
#> [2,]  0.7972541 -0.515845431 -0.02030443
#> [3,] -0.4422205  0.743382456 -0.71530688
#> 
#> [[8]]
#>            [,1]        [,2]        [,3]
#> [1,] -0.3689781  0.04630413 -0.00768968
#> [2,]  0.7922316 -0.49115487 -0.03364059
#> [3,] -0.4339486  0.74451940 -0.71279424
#> 
#> [[9]]
#>            [,1]        [,2]         [,3]
#> [1,] -0.3228484  0.02122083 -0.015559204
#> [2,]  0.8235633 -0.46047980  0.004007384
#> [3,] -0.4377454  0.69508981 -0.640505961
#> 
#> [[10]]
#>            [,1]        [,2]        [,3]
#> [1,] -0.3206057 -0.03453232  0.02412758
#> [2,]  0.7727958 -0.49298905  0.03740576
#> [3,] -0.4034720  0.73666860 -0.68481022
#>