Skip to content

Commit 4f30211

Browse files
kagalenko-m-bkagalenko-m-b
kagalenko-m-b
authored andcommitted
Remove unneeded stuff from tests
1 parent c135edf commit 4f30211

File tree

3 files changed

+10
-36
lines changed

3 files changed

+10
-36
lines changed

src/signalcorr.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ end
4343

4444
default_autolags(lx::Int) = 0 : default_laglen(lx)
4545

46-
_autodot(x::AbstractVector{<:RealFP}, lx::Int, l::Int) = dot(x, 1:(lx-l), x, (1+l):lx)
46+
_autodot(x::AbstractVector{<:Union{Float32, Float64}}, lx::Int, l::Int) = dot(x, 1:(lx-l), x, (1+l):lx)
4747
_autodot(x::AbstractVector, lx::Int, l::Int) = dot(view(x, 1:(lx-l)), view(x, (1+l):lx))
4848

4949

@@ -213,7 +213,7 @@ autocor(x::AbstractVecOrMat; demean::Bool=true) =
213213

214214
default_crosslags(lx::Int) = (l=default_laglen(lx); -l:l)
215215

216-
function _crossdot(x::AbstractVector{T}, y::AbstractVector{T}, lx::Int, l::Int) where {T<:RealFP}
216+
function _crossdot(x::AbstractVector, y::AbstractVector, lx::Int, l::Int)
217217
if l >= 0
218218
dot(x, 1:(lx-l), y, (1+l):lx)
219219
else
@@ -302,7 +302,7 @@ function crosscov!(r::AbstractMatrix, x::AbstractVector, y::AbstractMatrix, lags
302302
return r
303303
end
304304

305-
function crosscov!(r::AbstractArray{<:Any}, x::AbstractMatrix, y::AbstractMatrix, lags::AbstractVector{<:Integer}; demean::Bool=true)
305+
function crosscov!(r::AbstractArray{<:Any,3}, x::AbstractMatrix, y::AbstractMatrix, lags::AbstractVector{<:Integer}; demean::Bool=true)
306306
lx = size(x, 1)
307307
nx = size(x, 2)
308308
ny = size(y, 2)
@@ -458,7 +458,7 @@ function crosscor!(r::AbstractMatrix, x::AbstractVector, y::AbstractMatrix, lags
458458
return r
459459
end
460460

461-
function crosscor!(r::AbstractArray{<:Any}, x::AbstractMatrix, y::AbstractMatrix, lags::AbstractVector{<:Integer}; demean::Bool=true)
461+
function crosscor!(r::AbstractArray{<:Any, 3}, x::AbstractMatrix, y::AbstractMatrix, lags::AbstractVector{<:Integer}; demean::Bool=true)
462462
lx = size(x, 1)
463463
nx = size(x, 2)
464464
ny = size(y, 2)
@@ -568,8 +568,9 @@ function pacf_regress!(r::AbstractMatrix, X::AbstractMatrix, lags::AbstractVecto
568568
end
569569

570570
function pacf_yulewalker!(r::AbstractMatrix, X::AbstractMatrix, lags::AbstractVector{<:Integer}, mk::Integer)
571-
p = Vector{eltype(X)}(undef, mk)
572-
y = Vector{eltype(X)}(undef, mk)
571+
T = eltype(X)
572+
p = Vector{T}(undef, mk)
573+
y = Vector{T}(undef, mk)
573574
for j = 1 : size(X,2)
574575
acfs = autocor(X[:,j], 1:mk)
575576
durbin!(acfs, y, p)

test/rcall_test.jl

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/signalcorr.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ cmplx_x2 = convert(AbstractVector{Complex}, x2)
2929

3030
@test autocov([1:5;]) [2.0, 0.8, -0.2, -0.8, -0.8]
3131
@test autocor([1, 2, 3, 4, 5]) [1.0, 0.4, -0.1, -0.4, -0.4]
32+
@test_throws MethodError autocov([1 missing 2 3 4 5])
33+
@test_throws MethodError autocor([1 missing 2 3 4 5])
3234

3335
acovx1 = [0.755284179631112 + 0.0im,
3436
-0.005333112170365584 - 0.18633291805458002im,
@@ -144,7 +146,7 @@ function yulewalker_qr(v::AbstractVector)
144146
x = -A\b
145147
end
146148
function toeplitz(v::AbstractVector{T}) where T
147-
N=length(v)
149+
N = length(v)
148150
A = zeros(T, N - 1, N - 1)
149151
for n in 1:N-1
150152
A[n, n+1:end] = conj(v[2:N-n])

0 commit comments

Comments
 (0)