@s-andrews @ewels
Expected: The function below named getZScoreForValue should calculate the Z-Score.
Actual: The implementation is actually the probability density function (PDF) of the normal distribution at a given value
Looking at the code calling the function (and chatting with a colleague who knows more about FastQC's intention here) we came to the conclusion that the function is just misnamed and the behaviour of the code is correct but cant be sure.
If you can let me know either way i'll ensure that the function has the correct name and add unit tests demonstrating its behaviour.
https://github.com/s-andrews/FastQC/blob/master/uk/ac/babraham/FastQC/Statistics/NormalDistribution.java
public class NormalDistribution {
private double mean;
private double stdev;
public NormalDistribution (double mean, double stdev) {
this.mean = mean;
this.stdev = stdev;
}
public double getZScoreForValue (double value) {
double lhs = 1d/(Math.sqrt(2*Math.PI*stdev*stdev));
double rhs = Math.pow(Math.E, 0 - (Math.pow(value-mean,2)/(2*stdev*stdev)));
return lhs*rhs;
}
}
ChatGPT helped to decipher the issue.

@s-andrews @ewels
Expected: The function below named
getZScoreForValueshould calculate the Z-Score.Actual: The implementation is actually the
probability density function (PDF) of the normal distribution at a given valueLooking at the code calling the function (and chatting with a colleague who knows more about FastQC's intention here) we came to the conclusion that the function is just misnamed and the behaviour of the code is correct but cant be sure.
If you can let me know either way i'll ensure that the function has the correct name and add unit tests demonstrating its behaviour.
https://github.com/s-andrews/FastQC/blob/master/uk/ac/babraham/FastQC/Statistics/NormalDistribution.java
ChatGPT helped to decipher the issue.