Merck / CEEDesigns.jl

A decision-making framework for the cost-efficient design of experiments, balancing the value of acquired experimental evidence and incurred costs.

Home Page:https://merck.github.io/CEEDesigns.jl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mahalanobis distance with missing entries

thevolatilebit opened this issue · comments

The Mahalanobis distance between a state with missing readouts for a subset of features and a "historical" row is essentially calculated as if we were setting the missing entry equal to the respective record in the "historical" row. See the following link for reference:

compute_distances = function (evidence::Evidence)
if isempty(evidence)
return zeros(nrow(data))
else
vec_evidence = map(colname -> get(evidence, colname, 0), non_targets)
distances = map(eachrow(data)) do row
vec_row = map(
colname -> haskey(evidence, colname) ? row[colname] : 0,
non_targets,
)
z = vec_evidence - vec_row
dot(z, Λ * z)
end

However, this might not be the optimal approach. For more information, consider the following resources: https://search.r-project.org/CRAN/refmans/modi/html/MDmiss.html and also https://www.jstor.org/stable/3559861, particularly on page 285.