Skip to content

Commit

Permalink
Remove unneeded stuff from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kagalenko-m-b authored and kagalenko-m-b committed May 29, 2022
1 parent d3b92e8 commit 202ac84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 47 deletions.
29 changes: 0 additions & 29 deletions test/rcall_test.jl

This file was deleted.

28 changes: 10 additions & 18 deletions test/signalcorr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,17 @@ pacf_ls = [-1.598495044296996e-03 - 2.915104118351207e-01im

@test pacf(x1, 1:4) pacf_ls[1:4]

## pacf Yule-Walker

function yulewalker_qr(v::AbstractVector)
A = toeplitz(v)
b = v[2:end]
x = -A\b
end
function toeplitz(v::AbstractVector{T}) where T
N = length(v)
A = zeros(T, N - 1, N - 1)
for n in 1:N-1
A[n, n+1:end] = conj(v[2:N-n])
A[n, 1:n] = reverse(v[1:n])
end
return A
end
# durbin solver
## PACF Durbin solver
p_qr = [ 0.007061066965510003 + 0.2467057077053922im
0.3390065585042673 - 0.19328284216710082im
0.17336154780689775 - 0.026816622064955047im
0.17103798323175215 - 0.16022674917138569im
-0.10466472359738815 - 0.1320218198465664im
0.0486999464280363 - 0.10069213696609468im
0.056254003938430636 - 0.09745957137815701im
-0.07247287124498031 + 0.05734525689737796im
0.10967412213230482 - 0.05581001671362978im]
acf = autocor(x1)
p_qr = [yulewalker_qr(acf[1:n])[n-1] for n in 2:length(acf)]
y = similar(acf[2:end])
pd = similar(acf[2:end])
StatsBase.durbin!(acf[2:end], y, pd)
Expand Down

0 comments on commit 202ac84

Please sign in to comment.