The Perron-Frobenius eigenvalue of a positive matrix.

pf_eigenvalue(X)

Arguments

X

An Expression or positive square matrix.

Value

An Expression representing the largest eigenvalue of the input.

Details

For an elementwise positive matrix \(X\), this atom represents its spectral radius, i.e., the magnitude of its largest eigenvalue. Because \(X\) is positive, the spectral radius equals its largest eigenvalue, which is guaranteed to be positive.

This atom is log-log convex.

Examples

n <- 3
X <- Variable(n, n, pos=TRUE)
objective_fn <- pf_eigenvalue(X)
constraints <- list( X[1,1]== 1.0,
                     X[1,3] == 1.9,
                     X[2,2] == .8,
                     X[3,1] == 3.2,
                     X[3,2] == 5.9,
                     X[1, 2] * X[2, 1] * X[2,3] * X[3,3] == 1)
problem <- Problem(Minimize(objective_fn), constraints)
result <- solve(problem, gp=TRUE)
result$value
#> [1] 4.702374
result$getValue(X)
#>           [,1]     [,2]      [,3]
#> [1,] 1.0000000 4.636169 1.9000000
#> [2,] 0.4999174 0.800000 0.3777415
#> [3,] 3.2000000 5.900000 1.1422148