public WilcoxonSignedRankTest(double[] sample, double hypothesizedMedian = 0,
OneSampleHypothesis alternate = OneSampleHypothesis.ValueIsDifferentFromHypothesis)
{
int[] signs = new int[sample.Length];
double[] diffs = new double[sample.Length];
// 1. Compute absolute difference and sign function
for (int i = 0; i < sample.Length; i++)
{
double d = sample[i] - hypothesizedMedian;
signs[i] = Math.Sign(d);
diffs[i] = Math.Abs(d);
}
this.Hypothesis = alternate;
Compute(signs, diffs, (DistributionTail)alternate);
}