Package jmt.engine.jwat

Examples of jmt.engine.jwat.VariableNumber


          for (int i = 1; i < 9; i++) {
            g1.drawLine(1, 1 + (i * (HEIGHT / 9)), 499, 1 + (i * (HEIGHT / 9)));
            g1.drawLine(1 + (i * (WIDTH / 9)), 1, 1 + (i * (WIDTH / 9)), 499);
          }
          g1.setColor(Color.RED);
          VariableNumber x = model.getMatrix().getVariables()[xVar];
          x.setRangeIntervallo(x.getIndexMin(xMin), x.getIndexMax(xMax), yMin, yMax, yVar);

          try {
            initShow(x.Size());
          } catch (InterruptedException e1) {
            e1.printStackTrace();
          } catch (InvocationTargetException e1) {
            e1.printStackTrace();
          }

          int xPos = 0;
          g1.setColor(JavaWatColor.getColor(match));
          for (int i = 0; i < x.Size(); i++) {
            try {
              xPos = x.getNextInt();
              if (i % getStep() == 0) {
                updateInfos(i, "Plotting obs " + i, false);
              }
              if (c1[curClust][x.getObsID(xPos) - 1] == match) {
                g1.fillOval((int) ((x.getValue(xPos) - xMin) / (xMax - xMin) * (WIDTH - 1)), (HEIGHT - 1)
                    - (int) ((x.getValue(xPos, yVar) - yMin) / (yMax - yMin) * (HEIGHT - 1)), pointSize, pointSize);
              }
            } catch (Exception e) {
              break;
            }
          }
          updateInfos(x.Size(), "End", true);
          return null;
        }

        @Override
        public void finished() {
View Full Code Here


        TimeConsumingWorker worker = new TimeConsumingWorker(new ProgressMonitorShow(DispMatrix.this, "Plotting scatters...", 1)) {
          @Override
          public Object construct() {
            //doWork();
            Graphics g = chart.getGraphics();
            VariableNumber Elenco[] = model.getMatrix().getVariables();
            try {
              // Pulizia dell'immagine
              g.setColor(Color.WHITE);
              g.fillRect(0, 0, WIDTH_TOT * Elenco.length + 1, HEIGHT_TOT * Elenco.length + 1);

View Full Code Here

          for (int i = 1; i < 9; i++) {
            g1.drawLine(1, 1 + (i * (HEIGHT / 9)), 499, 1 + (i * (HEIGHT / 9)));
            g1.drawLine(1 + (i * (WIDTH / 9)), 1, 1 + (i * (WIDTH / 9)), 499);
          }
          g1.setColor(Color.RED);
          VariableNumber x = model.getMatrix().getVariables()[xVar];
          x.setRangeIntervallo(x.getIndexMin(xMin), x.getIndexMax(xMax), yMin, yMax, yVar);
          /* 28 Settembre */
          try {
            initShow(x.Size());
          } catch (InterruptedException e1) {
            e1.printStackTrace();
          } catch (InvocationTargetException e1) {
            e1.printStackTrace();
          }
          int xPos = 0;
          for (int i = 0; i < x.Size(); i++) {
            try {
              xPos = x.getNextInt();
              if (i % getStep() == 0) {
                updateInfos(i, "Plotting obs " + i, false);
              }
              g1.fillOval((int) ((x.getValue(xPos) - xMin) / (xMax - xMin) * (WIDTH - 2)), (HEIGHT - 2)
                  - (int) ((x.getValue(xPos, yVar) - yMin) / (yMax - yMin) * (HEIGHT - 1)), pointSize, pointSize);
            } catch (Exception e) {
              break;
            }
          }
          updateInfos(x.Size(), "End", true);
          return null;
        }

        @Override
        public void finished() {
View Full Code Here

    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();
  }
View Full Code Here

TOP

Related Classes of jmt.engine.jwat.VariableNumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.