pulled expectation out of sum over datapoints