solve_toeplitz(c_or_cr, b, check_finite=True)
The Toeplitz matrix has constant diagonals, with c as its first column and r as its first row. If r is not given, r == conjugate(c)
is assumed.
The solution is computed using Levinson-Durbin recursion, which is faster than generic least-squares methods, but can be less numerically stable.
The vector c
, or a tuple of arrays ( c
, r
). Whatever the actual shape of c
, it will be converted to a 1-D array. If not supplied, r = conjugate(c)
is assumed; in this case, if c[0] is real, the Toeplitz matrix is Hermitian. r[0] is ignored; the first row of the Toeplitz matrix is [c[0], r[1:]]
. Whatever the actual shape of r
, it will be converted to a 1-D array.
Right-hand side in T x = b
.
Whether to check that the input matrices contain only finite numbers. Disabling may give a performance gain, but may result in problems (result entirely NaNs) if the inputs do contain infinities or NaNs.
Solve a Toeplitz system using Levinson Recursion
toeplitz
Toeplitz matrix
[ 1 -1 -2 -3] [1]
T = [ 3 1 -1 -2] b = [2]
[ 6 3 1 -1] [2] [10 6 3 1] [5]
To specify the Toeplitz matrix, only the first column and the first row are needed.
>>> c = np.array([1, 3, 6, 10]) # First column of T
... r = np.array([1, -1, -2, -3]) # First row of T
... b = np.array([1, 2, 2, 5])
>>> from scipy.linalg import solve_toeplitz, toeplitz
... x = solve_toeplitz((c, r), b)
... x array([ 1.66666667, -1. , -2.66666667, 2.33333333])
Check the result by creating the full Toeplitz matrix and multiplying it by x
. We should get b
.
>>> T = toeplitz(c, r)See :
... T.dot(x) array([ 1., 2., 2., 5.])
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.linalg._basic.matmul_toeplitz
scipy.linalg._basic.solve_toeplitz
scipy.linalg._special_matrices.toeplitz
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them