double sumWeightedXDiffSquared = 0;
double sumWeightedYDiffSquared = 0;
m_slope = 0;
for (int j = 0; j < insts.numInstances(); j++) {
Instance inst = insts.instance(j);
if (!inst.isMissing(i) && !inst.classIsMissing()) {
double xDiff = inst.value(i) - xMean;
double yDiff = inst.classValue() - yMean;
double weightedXDiff = inst.weight() * xDiff;
double weightedYDiff = inst.weight() * yDiff;
m_slope += weightedXDiff * yDiff;