Use fuzzy set analysis to infer missing values. You provide a sigma function, a membership function, and a kernel.
Seamus Abshere, Ian Hough, Matt Kling
gem "fuzzy_infer", "~> 0.0.2"