Scales a square matrix so that its spectral radius is strictly less than 1 by a specified stability margin. This is useful for ensuring that transition matrices in state space or vector autoregressive (VAR) models are stationary. If the matrix is already within the margin, it is returned unchanged.
Value
A numeric matrix of the same dimensions as x
,
scaled if necessary to satisfy the stability constraint.
Details
The projection is performed
by multiplying the matrix by a constant factor
\(c = \frac{\text{margin}}{\rho + \text{tol}}\),
where \(\rho\) is the spectral radius and tol
is a small positive number to prevent division by zero.
See also
Other Simulation of State Space Models Data Functions:
LinSDE2SSM()
,
LinSDECovEta()
,
LinSDECovY()
,
LinSDEMeanEta()
,
LinSDEMeanY()
,
ProjectToHurwitz()
,
SSMCovEta()
,
SSMCovY()
,
SSMMeanEta()
,
SSMMeanY()
,
SimAlphaN()
,
SimBetaN()
,
SimBetaN2()
,
SimCovDiagN()
,
SimCovN()
,
SimIotaN()
,
SimPhiN()
,
SimPhiN2()
,
SimSSMFixed()
,
SimSSMIVary()
,
SimSSMLinGrowth()
,
SimSSMLinGrowthIVary()
,
SimSSMLinSDEFixed()
,
SimSSMLinSDEIVary()
,
SimSSMOUFixed()
,
SimSSMOUIVary()
,
SimSSMVARFixed()
,
SimSSMVARIVary()
,
SpectralRadius()
,
TestPhi()
,
TestPhiHurwitz()
,
TestStability()
,
TestStationarity()
Examples
# Matrix with eigenvalues greater than 1
x <- matrix(
data = c(
1.2, 0.3,
0.4, 0.9
),
nrow = 2
)
SpectralRadius(x = x) # > 1
#> [1] 1.427492
SpectralRadius(x = ProjectToStability(x = x)) # < 1
#> [1] 0.98
# Matrix already stable is returned unchanged
x <- matrix(
data = c(
0.5, 0.3,
0.2, 0.4
),
nrow = 2
)
identical(ProjectToStability(x = x), x)
#> [1] TRUE