code: public void add(double x)
      {
          if (Double.isNaN(mean))//fist case
          {
              mean = x;
              variance = 0;
          }
          else//general case
          {
              //first update stnd deviation 
              variance = (1-smoothing)*(variance + smoothing*Math.pow(x-mean, 2));
              mean = (1-smoothing)*mean + smoothing*x;
          }
                      
      }
docs: Adds the given data point to the statistics
  
  @param x the new value to add to the moving statistics