Skip to content

Commit 12bb75c

Browse files
authored
Merge pull request #730 from bowring/issue728
Fixed #728
2 parents fe6313b + f9b8a46 commit 12bb75c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

squidCore/src/main/java/org/cirdles/squid/algorithms/weightedMeans/WeightedMeanCalculators.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ public static WtdLinCorrResults wtdLinCorr(double[] y, double[][] sigRho, double
195195
double mswd = mswdW[minIndex];
196196
double probfit = probW[minIndex];
197197

198-
if (linReg && (minIndex > 0)) {
198+
// fixed per issue #728
199+
if (linReg) {
199200
wtdLinCorrResults.setSlope(slopeW[minIndex]);
200201
wtdLinCorrResults.setSigmaSlope(sigmaSlopeW[minIndex]);
201202
wtdLinCorrResults.setCovSlopeInter(covSlopeInterW[minIndex]);
@@ -332,7 +333,7 @@ public static DeletePointResults deletePoint(int rejPoint, double[] y1, double[]
332333
} else if ((j == (rejPoint - 1)) && (m < (n - 1))) {
333334
sigRho2[j][m] = 0.0;
334335
sigRho2[m][j] = 0.0;
335-
} else if ((j < (n - 2)) && (p < n)){
336+
} else if ((j < (n - 2)) && (p < n)) {
336337
sigRho2[j][m] = sigRho1[m][p];
337338
sigRho2[m][j] = sigRho1[p][m];
338339
}

squidCore/src/test/java/org/cirdles/squid/algorithms/weightedMeans/WeightedMeanCalculatorsTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public void wtdLinCorr() throws Exception {
3232
{0.0, 0.0, 0.25, 0.003803284943932538, 0.25},
3333
{0.0, 0.0, 0.0, 0.25, 0.003803284943932538}};
3434
expectedBad = false;
35-
expectedSlope = 0.0;
35+
expectedSlope = -4.5494878620412566E-5;
3636
expectedIntercept = 1.8464967500150462;
37-
expectedSigmaSlope = 0.0;
37+
expectedSigmaSlope = 6.924027363443903E-6;
3838
expectedSigmaIntercept = 0.004522048443740375;
39-
expectedCovSlopeInter = 0.0;
39+
expectedCovSlopeInter = -2.8336583202677104E-8;
4040
expectedMswd = 1.2623509241318576;
4141
expectedProbFit = 0.2853957071615587;
4242
WtdLinCorrResults results = WeightedMeanCalculators.wtdLinCorr(y, sigRho, x);

0 commit comments

Comments
 (0)