A non-ergodic framework for variograms and covariance functions