3
3
4
4
Solve Yule-Walker equations using Durbin algorithm.
5
5
6
- Solution of NxN system is obtained iteratively, by solving 1x1, 2x2 , ...
6
+ Solution of N×N system is obtained iteratively, by solving 1×1, 2×2 , ...
7
7
in succession. For use in computing partial autocorrelation matrix,
8
- return the last elements of the successive solutions in vector p[] .
8
+ return the last elements of the successive solutions in vector `p` .
9
9
10
- The section 4.7 of Golub,VanLoan "Matrix Computations," 4th ed.,
11
- discusses the algorithm in detail.
10
+ Reference: Golub, G. H., and C. F. Van Loan. "Matrix computations 4th edition the johns hopkins university press." Baltimore, MD (2013), section 4.7
12
11
13
12
# Arguments
14
- - `r::AbstractVector`: first column of a herimitian positive definite
13
+ - `r::AbstractVector`: first column of a Herimitian positive definite
15
14
Toeplitz matrix, excluding the diagonal element (equal to one).
16
15
- `y::AbstractVector`: work vector for solution, should have the same length
17
- as r[]
16
+ as `r`
18
17
- `p::AbstractVector`: last elements of the successive solutions, should
19
- have the same length as r[]
18
+ have the same length as `r`
20
19
21
20
# Returns
22
- - `y::AbstractVector`: same as the second argument
21
+ - `y::AbstractVector`: return the solution vector ( same as the second argument)
23
22
"""
24
- function durbin! (r:: AbstractVector{T} , y:: AbstractVector{T} , p:: AbstractVector{T} ) where T
23
+ function durbin! (r:: AbstractVector{T} , y:: AbstractVector{T} , p:: AbstractVector{T} ) where {T}
25
24
n = length (r)
26
25
n <= length (p) || n <= length (y) || throw (DimensionMismatch (" Auxiliary vectors cannot be shorter than data vector" ))
27
26
y[1 ] = - r[1 ]
@@ -48,7 +47,7 @@ function durbin!(r::AbstractVector{T}, y::AbstractVector{T}, p::AbstractVector{T
48
47
end
49
48
return y
50
49
end
51
- durbin (r:: AbstractVector{T} ) where T = durbin! (r, zeros (T, length (r)), zeros (T, length (r)))
50
+ durbin (r:: AbstractVector{T} ) where {T} = durbin! (r, zeros (T, length (r)), zeros (T, length (r)))
52
51
53
52
function levinson! (r:: AbstractVector{T} , b:: AbstractVector{T} , x:: AbstractVector{T} ) where T<: BlasReal
54
53
n = length (b)
0 commit comments