|
43 | 43 |
|
44 | 44 | default_autolags(lx::Int) = 0 : default_laglen(lx)
|
45 | 45 |
|
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) |
47 | 47 | _autodot(x::AbstractVector, lx::Int, l::Int) = dot(view(x, 1:(lx-l)), view(x, (1+l):lx))
|
48 | 48 |
|
49 | 49 |
|
@@ -213,7 +213,7 @@ autocor(x::AbstractVecOrMat; demean::Bool=true) =
|
213 | 213 |
|
214 | 214 | default_crosslags(lx::Int) = (l=default_laglen(lx); -l:l)
|
215 | 215 |
|
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) |
217 | 217 | if l >= 0
|
218 | 218 | dot(x, 1:(lx-l), y, (1+l):lx)
|
219 | 219 | else
|
@@ -302,7 +302,7 @@ function crosscov!(r::AbstractMatrix, x::AbstractVector, y::AbstractMatrix, lags
|
302 | 302 | return r
|
303 | 303 | end
|
304 | 304 |
|
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) |
306 | 306 | lx = size(x, 1)
|
307 | 307 | nx = size(x, 2)
|
308 | 308 | ny = size(y, 2)
|
@@ -458,7 +458,7 @@ function crosscor!(r::AbstractMatrix, x::AbstractVector, y::AbstractMatrix, lags
|
458 | 458 | return r
|
459 | 459 | end
|
460 | 460 |
|
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) |
462 | 462 | lx = size(x, 1)
|
463 | 463 | nx = size(x, 2)
|
464 | 464 | ny = size(y, 2)
|
@@ -568,8 +568,9 @@ function pacf_regress!(r::AbstractMatrix, X::AbstractMatrix, lags::AbstractVecto
|
568 | 568 | end
|
569 | 569 |
|
570 | 570 | 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) |
573 | 574 | for j = 1 : size(X,2)
|
574 | 575 | acfs = autocor(X[:,j], 1:mk)
|
575 | 576 | durbin!(acfs, y, p)
|
|
0 commit comments