# Matrix with eigenvalues less than 1
x <- matrix(
data = c(
0.5, 0.3,
0.2, 0.4
),
nrow = 2
)
SpectralRadius(x)
# Matrix with eigenvalues greater than 1
y <- matrix(
data = c(
1.2, 0.3,
0.4, 0.9
),
nrow = 2
)
SpectralRadius(y)
Run the code above in your browser using DataLab