Simulate Random Drift Matrices from the Multivariate Normal Distribution
Source:R/RcppExports.R
SimPhiN.Rd
This function simulates random drift matrices
from the multivariate normal distribution.
The function ensures that the generated drift matrices are stable
using TestPhi()
.
See also
Other Simulation of State Space Models Data Functions:
LinSDE2SSM()
,
LinSDECovEta()
,
LinSDECovY()
,
LinSDEMeanEta()
,
LinSDEMeanY()
,
ProjectToHurwitz()
,
ProjectToStability()
,
SSMCovEta()
,
SSMCovY()
,
SSMMeanEta()
,
SSMMeanY()
,
SimAlphaN()
,
SimBetaN()
,
SimBetaN2()
,
SimCovDiagN()
,
SimCovN()
,
SimIotaN()
,
SimPhiN2()
,
SimSSMFixed()
,
SimSSMIVary()
,
SimSSMLinGrowth()
,
SimSSMLinGrowthIVary()
,
SimSSMLinSDEFixed()
,
SimSSMLinSDEIVary()
,
SimSSMOUFixed()
,
SimSSMOUIVary()
,
SimSSMVARFixed()
,
SimSSMVARIVary()
,
SpectralRadius()
,
TestPhi()
,
TestPhiHurwitz()
,
TestStability()
,
TestStationarity()
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.3190641 0.03503587 0.02114061
#> [2,] 0.7662336 -0.48145138 -0.01244207
#> [3,] -0.4364891 0.77205909 -0.68438869
#>
#> [[2]]
#> [,1] [,2] [,3]
#> [1,] -0.3394220 0.05248648 0.062837536
#> [2,] 0.7783253 -0.58011157 0.004901415
#> [3,] -0.4661241 0.76906195 -0.650828177
#>
#> [[3]]
#> [,1] [,2] [,3]
#> [1,] -0.3162300 -0.00156391 -0.02669320
#> [2,] 0.7447820 -0.55108987 0.01353968
#> [3,] -0.4417182 0.77294645 -0.68782445
#>
#> [[4]]
#> [,1] [,2] [,3]
#> [1,] -0.3425154 0.02838189 0.01433782
#> [2,] 0.7610361 -0.53387189 0.02186514
#> [3,] -0.4443914 0.76735112 -0.68585070
#>
#> [[5]]
#> [,1] [,2] [,3]
#> [1,] -0.3786049 0.02613982 0.04793082
#> [2,] 0.7696926 -0.53921143 0.02534600
#> [3,] -0.4986717 0.73863608 -0.69941142
#>
#> [[6]]
#> [,1] [,2] [,3]
#> [1,] -0.2926671 0.06408923 -0.06179864
#> [2,] 0.7507533 -0.49265442 -0.04235275
#> [3,] -0.4439021 0.74013590 -0.72922121
#>
#> [[7]]
#> [,1] [,2] [,3]
#> [1,] -0.3528044 0.01056376 0.018110223
#> [2,] 0.7481218 -0.49991164 0.006361179
#> [3,] -0.3979919 0.69905303 -0.687941615
#>
#> [[8]]
#> [,1] [,2] [,3]
#> [1,] -0.3312080 -0.03685342 0.01274581
#> [2,] 0.7317721 -0.49631504 0.01093565
#> [3,] -0.4326465 0.74995482 -0.66396122
#>
#> [[9]]
#> [,1] [,2] [,3]
#> [1,] -0.3610083 -0.03531067 -0.033914896
#> [2,] 0.7960642 -0.50036814 0.003523242
#> [3,] -0.3862721 0.73619880 -0.727511046
#>
#> [[10]]
#> [,1] [,2] [,3]
#> [1,] -0.3484965 0.01285986 -0.02193760
#> [2,] 0.7208592 -0.51842387 -0.00686005
#> [3,] -0.5307973 0.68193233 -0.71138142
#>