private void testPlot(){
  ContinuousVariable c=new ContinuousVariable("test");
  if (dataSet.getVariable("test") == null)   dataSet.addVariable(c);
  ContinuousVariable c2=new ContinuousVariable("test2");
  if (dataSet.getVariable("test2") == null)   dataSet.addVariable(c2);
  this.selectedVariable=c;
  int columnIndex=dataSet.getColumn(c);
  Normal g=new Normal(1,1);
  Exponential e=new Exponential(1);
  double mean=0.0;
  double sd=0.0;
  this.minData=10000000000000.0;
  this.maxData=0.0;
  this.minComparison=1000000000000.0;
  this.maxComparison=0.0;
  for (int i=0; i < dataSet.getNumRows(); i++) {
    double value=g.nextRandom();
    double value2=e.nextRandom();
    dataSet.setDouble(i,columnIndex,value);
    dataSet.setDouble(i,columnIndex + 1,value2);
    mean+=value;
    if (value < this.minData)     this.minData=value;
    if (value > this.maxData)     this.maxData=value;
  }
  NormalityTests.kolmogorovSmirnov(dataSet,c2);
  for (int i=0; i < dataSet.getNumRows(); i++) {
    for (int k=i; k < dataSet.getNumRows(); k++) {
      if (dataSet.getDouble(i,columnIndex) > dataSet.getDouble(k,columnIndex)) {
        double temp=dataSet.getDouble(i,columnIndex);
        dataSet.setDouble(i,columnIndex,dataSet.getDouble(k,columnIndex));
        dataSet.setDouble(k,columnIndex,temp);
      }
    }
  }
  if (mean == 0.0)   mean=1.0;
 else   mean/=dataSet.getNumRows();
  for (int i=0; i < dataSet.getNumRows(); i++) {
    sd+=(dataSet.getDouble(i,columnIndex) - mean) * (dataSet.getDouble(i,columnIndex) - mean);
  }
  if (sd == 0.0) {
    sd=1.0;
  }
 else {
    sd/=dataSet.getNumRows() - 1.0;
    sd=Math.sqrt(sd);
  }
  this.comparison=new cern.jet.random.Normal(mean,sd,new MersenneTwister());
  calculateComparisonSet(this.comparison,this.dataSet);
  if (this.minData < this.minComparison)   this.min=this.minData;
 else   this.min=this.minComparison;
  if (this.maxData > this.maxComparison)   this.max=this.maxData;
 else   this.max=this.maxComparison;
}

private void testPlot ( ) { ContinuousVariable c = new ContinuousVariable ( "test" ) ; if ( dataSet . getVariable ( "test" ) == null ) dataSet . addVariable ( c ) ; ContinuousVariable c2 = new ContinuousVariable ( "test2" ) ; if ( dataSet . getVariable ( "test2" ) == null ) dataSet . addVariable ( c2 ) ; this . selectedVariable = c ; int columnIndex = dataSet . getColumn ( c ) ; Normal g = new Normal ( 1 , 1 ) ; Exponential e = new Exponential ( 1 ) ; double mean = 0.0 ; double sd = 0.0 ; this . minData = 10000000000000.0 ; this . maxData = 0.0 ; this . minComparison = 1000000000000.0 ; this . maxComparison = 0.0 ; for ( int i = 0 ; i < dataSet . getNumRows ( ) ; i ++ ) { double value = g . nextRandom ( ) ; double value2 = e . nextRandom ( ) ; dataSet . setDouble ( i , columnIndex , value ) ; dataSet . setDouble ( i , columnIndex + 1 , value2 ) ; mean += value ; if ( value < this . minData ) this . minData = value ; if ( value > this . maxData ) this . maxData = value ; } NormalityTests . kolmogorovSmirnov ( dataSet , c2 ) ; for ( int i = 0 ; i < dataSet . getNumRows ( ) ; i ++ ) { for ( int k = i ; k < dataSet . getNumRows ( ) ; k ++ ) { if ( dataSet . getDouble ( i , columnIndex ) > dataSet . getDouble ( k , columnIndex ) ) { double temp = dataSet . getDouble ( i , columnIndex ) ; dataSet . setDouble ( i , columnIndex , dataSet . getDouble ( k , columnIndex ) ) ; dataSet . setDouble ( k , columnIndex , temp ) ; } } } if ( mean == 0.0 ) mean = 1.0 ; else mean /= dataSet . getNumRows ( ) ; for ( int i = 0 ; i < dataSet . getNumRows ( ) ; i ++ ) { sd += ( dataSet . getDouble ( i , columnIndex ) - mean ) * ( dataSet . getDouble ( i , columnIndex ) - mean ) ; } if ( sd == 0.0 ) { sd = 1.0 ; } else { sd /= dataSet . getNumRows ( ) - 1.0 ; sd = Math . sqrt ( sd ) ; } this . comparison = new cern . jet . random . Normal ( mean , sd , new MersenneTwister ( ) ) ; calculateComparisonSet ( this . comparison , this . dataSet ) ; if ( this . minData < this . minComparison ) this . min = this . minData ; else this . min = this . minComparison ; if ( this . maxData > this . maxComparison ) this . max = this . maxData ; else this . max = this . maxComparison ; }
used to test this class . generates a continuous test variable and q - q plots it .
