# Unstable (spectral abscissa >= 0):
x <- matrix(
data = c(
0.10, -0.40,
0.50, 0.20
),
nrow = 2
)
SpectralAbscissa(x = x) # >= 0
SpectralAbscissa(x = ProjectToHurwitz(x = x)) # <= -1e-3 (default margin)
# Already Hurwitz-stable is returned unchanged up to numerics:
x <- matrix(
data = c(
-0.50, -0.20,
1.00, -0.30
),
nrow = 2
)
SpectralAbscissa(x = x) # < 0
identical(ProjectToHurwitz(x = x), x)
Run the code above in your browser using DataLab