10 double mean(std::vector<double>& Y)
14 for (
unsigned int i = 0; i < Y.size(); i++)
22 double var(std::vector<double>& Y)
25 double Yhat = mean(Y);
26 double variance = 0.0;
29 for (
int i = 0; i < N; i++)
31 variance += (Y[i] - Yhat) * (Y[i] - Yhat);