covariance function for fd+
previous implementations of sd() and var() for fd+ are wrong