1package umontreal.ssj.mcqmctools.anova;
3import umontreal.ssj.stat.Tally;
10public class PartialVariance
extends Tally implements Comparable<PartialVariance> {
13 protected Tally totalVar;
20 super(
"variance for coordinates " + coords);
22 this.totalVar = totalVar;
43 throw new IllegalStateException(
44 "trying to access the sensitivity index without" +
" a reference to the total variance");
46 return average() / totalVar.average();
57 return v > vx ? 1 : v < vx ? -1 : 0;
61 public String toString() {
63 String s = String.format(
"%30s: %9.4g", coords.toString(),
average());
67 s += String.format(
" ± %.2g", dvar);
70 if (totalVar !=
null) {
73 s += String.format(
" (%.4g %%)", 100 * varFrac);
double average()
Returns the average value of the observations since the last initialization.
int numberObs()
Returns the number of observations given to this probe since its last initialization.
double variance()
Returns the sample variance of the observations since the last initialization.
Tally()
Constructs a new unnamed Tally statistical probe.