Simulate Random Drift Matrices from the Multivariate Normal Distribution and Project to Hurwitz
Source:R/RcppExports.R
SimPhiN2.Rd
This function simulates random dirft matrices
from the multivariate normal distribution
then projects each draw to the Hurwitz-stable region
using ProjectToHurwitz()
.
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 of \(\mathrm{vec} \left( \boldsymbol{\Phi} \right)\).- margin
Positive numeric. Target buffer so that the spectral abscissa is \(\le -\text{margin}\) (default
1e-3
).
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()
,
SimNuN()
,
SimPhiN()
,
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)))
SimPhiN2(n = n, phi = phi, vcov_phi_vec_l = vcov_phi_vec_l)
#> [[1]]
#> [,1] [,2] [,3]
#> [1,] -0.3461487 0.0322910 0.01262215
#> [2,] 0.7449142 -0.5253309 0.03305843
#> [3,] -0.4975340 0.7853186 -0.73998345
#>
#> [[2]]
#> [,1] [,2] [,3]
#> [1,] -0.3615692 -0.03668001 0.0005504809
#> [2,] 0.7318196 -0.49750777 -0.0274337166
#> [3,] -0.4485742 0.69805598 -0.6928824748
#>
#> [[3]]
#> [,1] [,2] [,3]
#> [1,] -0.3304681 -0.01838064 -0.04678486
#> [2,] 0.7534764 -0.50637754 0.03727028
#> [3,] -0.4956332 0.74469756 -0.68462958
#>
#> [[4]]
#> [,1] [,2] [,3]
#> [1,] -0.3975887 -0.05272651 -0.085302392
#> [2,] 0.7927197 -0.53432838 -0.004704189
#> [3,] -0.4492825 0.73642496 -0.716512771
#>
#> [[5]]
#> [,1] [,2] [,3]
#> [1,] -0.3446627 0.02023395 0.03049497
#> [2,] 0.7672337 -0.52994584 -0.01360389
#> [3,] -0.4769160 0.71338521 -0.68765222
#>
#> [[6]]
#> [,1] [,2] [,3]
#> [1,] -0.3488294 -0.002825644 -0.05151846
#> [2,] 0.7693948 -0.511840568 0.01103531
#> [3,] -0.5055667 0.677296735 -0.73582263
#>
#> [[7]]
#> [,1] [,2] [,3]
#> [1,] -0.3640059 0.01491232 -0.016820119
#> [2,] 0.7871740 -0.47741060 -0.002503593
#> [3,] -0.3991533 0.76332088 -0.651841743
#>
#> [[8]]
#> [,1] [,2] [,3]
#> [1,] -0.3498894 0.008644179 0.04224443
#> [2,] 0.8016439 -0.528705326 0.01818416
#> [3,] -0.4456561 0.675355254 -0.72861089
#>
#> [[9]]
#> [,1] [,2] [,3]
#> [1,] -0.3365547 0.02514259 0.03446106
#> [2,] 0.7938113 -0.52518519 -0.07951748
#> [3,] -0.4749720 0.72711246 -0.68422099
#>
#> [[10]]
#> [,1] [,2] [,3]
#> [1,] -0.4015380 0.01008559 -0.03289046
#> [2,] 0.7673999 -0.48921153 0.02281463
#> [3,] -0.3932220 0.71701902 -0.75523524
#>