CovarianceMatrices.BartlettKernelType
BartlettKernel

Constructors

BartlettKernel(x::Int)
BartlettKernel(::Type{Andrews})
BartlettKernel(::Type{NeweyWest})

Note

• Andrews: bandwidth selection a la Andrews
• NeweyWest: bandwidth selection a la Andrews
CovarianceMatrices.BartlettSmootherType

Truncate(ξ::Int)

Construct a Bartlett<:Smoother with window half-size equal to ξ.

Given a matrix A[i,j], its smoothed version is defined as

$A[t, j] = \frac{1}{S_T} \sum_{s=max{t-T,-ξ}}^{min{t-1, ξ}} (1-|s/S_T|) A[t-s,j]$

where $S_T = (2\xi+1)/2$ is the bandwidth.

CovarianceMatrices.ParzenKernelType
ParzenKernel

Constructors

ParzenKernel(x::Int)
ParzenKernel(::Type{Andrews})
ParzenKernel(::Type{NeweyWest})

Note

• Andrews: bandwidth selection a la Andrews
• NeweyWest: bandwidth selection a la Andrews
CovarianceMatrices.QuadraticSpectralKernelType
QuadraticSpectralKernel

Constructors

QuadraticSpectralKernel(x::Int)
QuadraticSpectralKernel(::Type{NeweyWest})

Note

• Andrews: bandwidth selection a la Andrews
• NeweyWest: bandwidth selection a la Andrews
CovarianceMatrices.TruncatedKernelType
TruncatedKernel

Constructors

TruncatedKernel{Fixed}(x::Int)
TruncatedKernel{Andrews}()
TruncatedKernel{NeweyWest}()

Note

• Fixed: fixed bandwidth
• Andrews: bandwidth selection a la Andrews
• NeweyWest: bandwidth selection a la Andrews
CovarianceMatrices.TruncatedSmootherType

Truncate(ξ::Int)

Construct a Truncated<:Smoother with window half-size equal to ξ.

Given a matrix A[i,j], its smoothed version is defined as

$A[t, j] = \frac{1}{S_T} \sum_{s=max{t-T,-ξ}}^{min{t-1, ξ}} A[t-s,j]$

where $S_T = (2\xi+1)/2$ is the bandwidth.

CovarianceMatrices.TukeyHanningKernelType
TukeyHanningKernel

Constructors

TukeyHanningKernel(x::Int)
TukeyHanningKernel(::Type{Andrews})
TukeyHanningKernel(::Type{NeweyWest})

Note

• Andrews: bandwidth selection a la Andrews
• NeweyWest: bandwidth selection a la Andrews
CovarianceMatrices.bysortMethod
bysort(x, f)

Sort each element of x according to f (a categorical).

Arguments

• x an iterable whose elements are arrays.
• f::CategoricalArray a categorical array defining the sorting order

Returns

• Tuple: a tuple (xs, fs) containing the sorted element of x and f
CovarianceMatrices.clustersindicesMethod
clustersindices(c::CRHCCache)

Return an array whose element i is a Range{Int} with indeces of the i-th cluster. Since the data is sorted when cached, the indices are contigous.

CovarianceMatrices.dofadjustmentMethod
dofadjustment(k::CRHC, ::CRHCCache)

Calculate the default degrees-of-freedom adjsutment for CRHC

Arguments

• k::CRHC: cluster robust variance type
• c::CRHCCache: the CRHCCache from which to extract the information

Return

• Float: the degrees-of-fredom adjustment

Note: the adjustment is a multyplicative factor.

CovarianceMatrices.optimalbandwidthMethod
optimalbandwidth(k::HAC{T}, mm; prewhite::Bool=false) where {T<:Andrews}
optimalbandwidth(k::HAC{T}, mm; prewhite::Bool=false) where {T<:NeweyWest}

Calculate the optimal bandwidth according to either Andrews or Newey-West.

CovarianceMatrices.ΓMethod
Γ(A::AbstractMatrix{T}, j::Int) where T

Calculate the autocovariance of order j of A.

Arguments

• A::AbstractMatrix{T}: the matrix whose autocorrelation need to be calculated
• j::Int: the autocorrelation order

Returns

• AbstractMatrix{T}: the autocovariance