this.setMarksStyle("various", 1);
this.setConnected(true, 2);
this.setMarksStyle("point", 2);
this.setColors(new Color[] { Color.RED, Color.BLUE });
if (distribution == SmallQQPlot.NORMAL) {
VariableNumber xvar = model.getMatrix().getVariables()[this.xvar];
double var = model.getMatrix().getVariables()[this.xvar].getUniStats().getVariance();
int[] qx = xvar.getUniStats().getQuantili();
double xRange = xvar.getUniStats().getRangeValue() / 100;
double yRange = (((normale[normale.length - 1] * var) + mean) - ((normale[0] * var) + mean)) / 100;
double xMin = xvar.getUniStats().getMinValue();
setXRange(xvar.getUniStats().getMinValue(), xvar.getUniStats().getMaxValue());
if (xvar.getType() == JWATConstants.DATE) {
SimpleDateFormat f = new SimpleDateFormat("dd.MM.yy HH:mm:ss");
addXTick(f.format(new Date((long) (xMin + xRange / 10))), xMin + xRange / 10);
addXTick(f.format(new Date((long) (xMin + (xRange * 100) / 2))), xMin + (xRange * 100) / 2);
addXTick(f.format(new Date((long) (xMin + (xRange * 99)))), xMin + (xRange * 99));
} else {
setXLabel("Quantiles of " + xvar.getName());
}
setYRange((normale[0] * var) + mean, (normale[normale.length - 1] * var) + mean);
setYLabel("Quantiles of normal distribution");
for (int i = 0; i < qx.length; i++) {
addPoint(1, xvar.getValue(qx[i]), (normale[i] * var) + mean, true);
addPoint(2, xMin + (xRange * i), ((normale[0] * var) + mean) + (yRange * i), true);
}
}
if (distribution == SmallQQPlot.EXPO) {
VariableNumber xvar = model.getMatrix().getVariables()[this.xvar];
int[] qx = xvar.getUniStats().getQuantili();
double xRange = xvar.getUniStats().getRangeValue() / 100;
double yRange = ((-Math.log(0.01) * mean) - (-Math.log(1) * mean)) / 100;
double xMin = xvar.getUniStats().getMinValue();
setXRange(xvar.getUniStats().getMinValue(), xvar.getUniStats().getMaxValue());
if (xvar.getType() == JWATConstants.DATE) {
SimpleDateFormat f = new SimpleDateFormat("dd.MM.yy HH:mm:ss");
addXTick(f.format(new Date((long) (xMin + (xRange * 100) / 10))), xMin + (xRange * 100) / 10);
addXTick(f.format(new Date((long) (xMin + (xRange * 100) / 2))), xMin + (xRange * 100) / 2);
addXTick(f.format(new Date((long) (xMin + (xRange * 99)))), xMin + (xRange * 99));
} else {
setXLabel("Quantiles of " + xvar.getName());
}
setYRange(-Math.log(1) * mean, -Math.log(0.01) * mean);
setYLabel("Quantiles of exponential distribution");
for (int i = 0; i < qx.length; i++) {
addPoint(1, xvar.getValue(qx[i]), -Math.log(1 - (0.01 * i)) * mean, true);
addPoint(2, xMin + (xRange * i), (yRange * i), true);
}
}
fillPlot();
}