@@ -44,7 +44,7 @@ Computational Statistics & Data Analysis 43.4 (2003): 541-552.
4444"""
4545function euclideanDistances (dataMatrix:: AbstractMatrix{Float64} ):: AbstractMatrix{Float64}
4646 n = size (dataMatrix, 1 )
47- d = zeros ( Float64, n, n)
47+ d = Array { Float64, 2} (undef , n, n)
4848 for i ∈ 1 : n
4949 for j ∈ i: n
5050 if i != j
6060
6161function mahalanobisSquaredBetweenPairs (pairs:: AbstractMatrix{Float64} ; covmatrix = nothing ):: Union{Nothing, AbstractMatrix}
6262 n = size (pairs, 1 )
63- newmat = zeros ( Float64, n, n)
63+ newmat = Array { Float64, 2} (undef , n, n)
6464 if isnothing (covmatrix)
6565 covmatrix = cov (pairs)
6666 end
@@ -105,7 +105,7 @@ function mahalanobisBetweenPairs(dataMatrix::AbstractMatrix{Float64})::Union{Not
105105
106106 n = size (dataMatrix, 1 )
107107
108- d = zeros ( Float64, n, n)
108+ d = Array { Float64, 2} (undef , n, n)
109109
110110 covmat = cov (dataMatrix)
111111
@@ -499,7 +499,7 @@ function cooks(X::AbstractMatrix{Float64}, y::AbstractVector{Float64})::Abstract
499499 res = residuals (olsreg)
500500 hat = hatmatrix (X)
501501 s2 = sum (res .* res) / (n - p)
502- d = zeros ( Float64, n)
502+ d = Array { Float64, 1} (undef , n)
503503 for i ∈ 1 : n
504504 d[i] = ((res[i]^ 2.0 ) / (p * s2)) * (hat[i, i] / (1 - hat[i, i])^ 2.0 )
505505 end
@@ -719,7 +719,7 @@ function hadimeasure(X::AbstractMatrix{Float64}, y::AbstractVector{Float64}; c::
719719 res2 = res .^ 2.0
720720 sumres = sum (res2)
721721 hat = hatmatrix (X)
722- H = zeros ( Float64, n)
722+ H = Array { Float64, 1} (undef , n)
723723 for i ∈ 1 : n
724724 H[i] =
725725 (p * res2[i]) / ((1 - hat[i, i]) * (sumres - res2[i])) +
0 commit comments