add covariance-by-distance.R