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;
sumWeightedXDiffSquared += weightedXDiff * xDiff;
sumWeightedYDiffSquared += weightedYDiff * yDiff;
}