public function addObservation( $x ) {
		$x = (float)$x;

		$this->min = min( $this->min, $x );
		$this->max = max( $this->max, $x );

		$n1 = $this->n;
		$this->n += 1;
		$delta = $x - $this->m1;
		$delta_n = $delta / $this->n;
		$this->m1 += $delta_n;
		$this->m2 += $delta * $delta_n * $n1;
	}
public function addObservation( $x ) {
		$x = (float)$x;

		$this->min = min( $this->min, $x );
		$this->max = max( $this->max, $x );

		$n1 = $this->n;
		$this->n += 1;
		$delta = $x - $this->m1;
		$delta_n = $delta / $this->n;
		$this->m1 += $delta_n;
		$this->m2 += $delta * $delta_n * $n1;
	}
public function addObservation ( $ x ) { $ x = ( float ) $ x ; $ this -> min = min ( $ this -> min , $ x ) ; $ this -> max = max ( $ this -> max , $ x ) ; $ n1 = $ this -> n ; $ this -> n += 1 ; $ delta = $ x - $ this -> m1 ; $ delta_n = $ delta / $ this -> n ; $ this -> m1 += $ delta_n ; $ this -> m2 += $ delta * $ delta_n * $ n1 ; }
Add a number to the data set.
@param int|float $x Value to add
Add a number to the data set .