Skip to content

Commit

Permalink
simplifying stat for Simon
Browse files Browse the repository at this point in the history
  • Loading branch information
plemey committed Dec 30, 2024
1 parent fb0d1de commit f37ecb6
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/dr/evomodel/continuous/ContinuousDiffusionStatistic.java
Original file line number Diff line number Diff line change
Expand Up @@ -461,14 +461,13 @@ public double getStatisticValue(int dim) {
}
} else if (summaryStat == summaryStatistic.SQUAREDDISTANCE_TIME4_CORRELATION) {
List<Double> squareddistances = squareElements(distances);
List<Double> timesFour = elementsTimesFour(times);
if (summaryMode == Mode.SPEARMAN) {
return getSpearmanRho(convertDoubles(timesFour),convertDoubles(squareddistances));
return getSpearmanRho(convertDoubles(times),convertDoubles(squareddistances));
} else if (summaryMode == Mode.R_SQUARED) {
Regression r = new Regression(convertDoubles(timesFour), convertDoubles(squareddistances));
Regression r = new Regression(convertDoubles(times), convertDoubles(squareddistances));
return r.getRSquared();
} else {
Regression r = new Regression(convertDoubles(timesFour),convertDoubles(squareddistances));
Regression r = new Regression(convertDoubles(times),convertDoubles(squareddistances));
return r.getCorrelationCoefficient();
}
} else {
Expand Down Expand Up @@ -511,14 +510,6 @@ private static List<Double> squareElements(List<Double> inputList) {
return squaredList;
}

private static List<Double> elementsTimesFour (List<Double> inputList) {
List<Double> returnList = new ArrayList<>();
for (Double number : inputList) {
returnList.add(number * 4);
}
return returnList;
}

private double[] imputeValue(double[] nodeValue, double[] parentValue, double time, double nodeHeight, double parentHeight, double[] precisionArray, double rate, boolean trueNoise) {

final double scaledTimeChild = (time - nodeHeight) * rate;
Expand Down

0 comments on commit f37ecb6

Please sign in to comment.