Skip to content

Commit

Permalink
fix diag(nothing) in mve
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytecode committed May 26, 2024
1 parent 4b9e885 commit 7422251
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ function enlargesubset(initialsubset, data::AbstractMatrix, h::Int)
covmatrix = cov(data[basicsubset, :])
md2mat =
mahalanobisSquaredMatrix(data, meanvector=meanvector, covmatrix=covmatrix)
md2 = diag(md2mat)
md2sortedindex = sortperm(md2)
basicsubset = md2sortedindex[1:(length(basicsubset)+1)]
if !isnothing(md2mat)
md2 = diag(md2mat)
md2sortedindex = sortperm(md2)
basicsubset = md2sortedindex[1:(length(basicsubset)+1)]
else
basicsubset = 1:(length(basicsubset)+1)
end
end
return basicsubset
end
Expand Down

0 comments on commit 7422251

Please sign in to comment.