The atoms of the geodesic analysis of SymbolicAnalysis.jl (analyze()
with a manifold). On numbers they compute their value; on a matrix
variable (a symcompR MatrixSymbol) they return the atom for analysis.
On the manifold of symmetric positive definite matrices: tr(X) (the
trace), conjugation(X, B) (\(B^T X B\)), scalar_mat(X, k)
(\(tr(X) I_k\)), sdivergence(X, Y) (the symmetric Stein divergence
\(logdet((X + Y)/2) - logdet(X Y)/2\)), distance(M, p, q) (the
Riemannian distance on M), log_quad_form(y, X) (\(log(y^T X y)\), or
the log of the sum over a list of vectors), eigsummax(m, k) and
eigsummin(m, k) (the sum of the k largest or smallest eigenvalues),
schatten_norm(X, p) (the p-norm of the eigenvalues),
sum_log_eigmax(f, X, k) (the sum of f of the logs of the k largest
eigenvalues; f defaults to the identity), affine_map(f, X, B, Y)
(\(B\) plus f of X: conjugation with a matrix or a list of
matrices Y, tr or diag, or hadamard_product with Y) and
hadamard_product(X, B) (the entrywise product). On the Lorentz model:
lorentz_log_barrier(p), lorentz_homogeneous_quadratic(A, p),
lorentz_homogeneous_diagonal(a, p),
lorentz_nonhomogeneous_quadratic(A, b, c, p),
lorentz_least_squares(X, y, p) and lorentz_transform(O, p), which
check the conditions for geodesic convexity on numbers. logdet(),
eigmax(), eigmin(), opnorm() and quad_form() also take a matrix
variable, and the inverse is symcompR's Inverse(X). The sum and the
diagonal of a matrix variable are Function("sum")(X) and
Function("diag")(X).
Usage
tr(X)
conjugation(X, B)
scalar_mat(X, k = nrow(X))
sdivergence(X, Y)
distance(M, p, q)
log_quad_form(y, X)
eigsummax(m, k)
eigsummin(m, k)
schatten_norm(X, p = 2L)
sum_log_eigmax(...)
affine_map(f, X, B, Y)
hadamard_product(X, B, ...)
lorentz_log_barrier(p)
lorentz_homogeneous_quadratic(A, p)
lorentz_homogeneous_diagonal(a, p)
lorentz_nonhomogeneous_quadratic(A, b, c, p)
lorentz_least_squares(X, y, p)
lorentz_transform(O, p)Arguments
- X, Y, m, B, A, O
Numeric matrices or matrix variables.
- k
An integer.
- M
A manifold:
SymmetricPositiveDefinite()orLorentz(). For two points of symcompR geometry,distance(p, q)is symcompR's.- p, q
Points: matrices on the positive definite manifold, vectors on the Lorentz model.
- y
A vector, or a list of vectors.
- ...
The arguments of
sum_log_eigmax:(f, X, k)or(X, k). Forhadamard_product(), further factors: a call with more than two factors, or with symbolic factors, is symcompR'shadamard_product().- f
A function name:
"conjugation","tr","diag"or"hadamard_product"foraffine_map; an elementwise function name forsum_log_eigmax.- a, b
Numeric vectors.
- c
A number.
Examples
A <- matrix(c(2, 0.5, 0.5, 1), 2)
conjugation(diag(2), A)
#> [,1] [,2]
#> [1,] 4.25 1.50
#> [2,] 1.50 1.25
sdivergence(A, diag(2))
#> [1] 0.0830976
X <- MatrixSymbol("X", 2, 2)
analyze(logdet(conjugation(X, A)) - logdet(X), SymmetricPositiveDefinite(2))$gcurvature
#> [1] "GConvex"