imate.sample_matrices.toeplitz_logdet#
- imate.sample_matrices.toeplitz_logdet(a, b, size, gram=False)#
Compute the log-determinant of Toeplitz matrix using an analytic formula.
The Toeplitz matrix using the entries \(a\) and \(b\) refers to the matrix generated by
imate.toeplitz()
.- Parameters:
- afloat
The diagonal elements of the Toeplitz matrix.
- bfloat
The upper off-diagonal elements of the Toeplitz matrix.
- sizeint, default=20
Size of the square matrix.
- grambool, default=False
If False, the matrix is assumed to be bi-diagonal Toeplitz. If True, the Gramian of the matrix is considered instead.
- Returns:
- logdetfloat
Natural logarithm of the determinant of Toeplitz matrix
See also
Notes
For the matrix \(\mathbf{A}\) given in
imate.toeplitz()
, the log-determinant is\[\mathrm{logdet}(\mathbf{A}) = n \log_e(a),\]where \(n\) is the size of the matrix. For the Gramian matrix, \(\mathbf{B} = \mathbf{A}^{\intercal} \mathbf{A}\) (when
gram
is set to True), the log-determinant is\[\mathrm{logdet}(\mathbf{B}) = 2 n \log_e(a)\]Examples
>>> from imate.sample_matrices import toeplitz_logdet >>> a, b = 2, 3 >>> toeplitz_logdet(a, b, size=6) 4.1588830833596715 >>> toeplitz_logdet(a, b, size=6, gram=True) 8.317766166719343