public function merge( RunningStat $other ) {
		// If the other RunningStat is empty, there's nothing to do.
		if ( $other->n === 0 ) {
			return;
		}

		// If this RunningStat is empty, copy values from other RunningStat.
		if ( $this->n === 0 ) {
			$this->n = $other->n;
			$this->m1 = $other->m1;
			$this->m2 = $other->m2;
			$this->min = $other->min;
			$this->max = $other->max;
			return;
		}

		$n = $this->n + $other->n;
		$delta = $other->m1 - $this->m1;
		$delta2 = $delta * $delta;

		$this->m1 = ( ( $this->n * $this->m1 ) + ( $other->n * $other->m1 ) ) / $n;
		$this->m2 = $this->m2 + $other->m2 + ( $delta2 * $this->n * $other->n / $n );
		$this->min = min( $this->min, $other->min );
		$this->max = max( $this->max, $other->max );
		$this->n = $n;
	}
public function merge( RunningStat $other ) {
		// If the other RunningStat is empty, there's nothing to do.
		if ( $other->n === 0 ) {
			return;
		}

		// If this RunningStat is empty, copy values from other RunningStat.
		if ( $this->n === 0 ) {
			$this->n = $other->n;
			$this->m1 = $other->m1;
			$this->m2 = $other->m2;
			$this->min = $other->min;
			$this->max = $other->max;
			return;
		}

		$n = $this->n + $other->n;
		$delta = $other->m1 - $this->m1;
		$delta2 = $delta * $delta;

		$this->m1 = ( ( $this->n * $this->m1 ) + ( $other->n * $other->m1 ) ) / $n;
		$this->m2 = $this->m2 + $other->m2 + ( $delta2 * $this->n * $other->n / $n );
		$this->min = min( $this->min, $other->min );
		$this->max = max( $this->max, $other->max );
		$this->n = $n;
	}
public function merge ( RunningStat $ other ) { // If the other RunningStat is empty, there's nothing to do. if ( $ other -> n === 0 ) { return ; } // If this RunningStat is empty, copy values from other RunningStat. if ( $ this -> n === 0 ) { $ this -> n = $ other -> n ; $ this -> m1 = $ other -> m1 ; $ this -> m2 = $ other -> m2 ; $ this -> min = $ other -> min ; $ this -> max = $ other -> max ; return ; } $ n = $ this -> n + $ other -> n ; $ delta = $ other -> m1 - $ this -> m1 ; $ delta2 = $ delta * $ delta ; $ this -> m1 = ( ( $ this -> n * $ this -> m1 ) + ( $ other -> n * $ other -> m1 ) ) / $ n ; $ this -> m2 = $ this -> m2 + $ other -> m2 + ( $ delta2 * $ this -> n * $ other -> n / $ n ) ; $ this -> min = min ( $ this -> min , $ other -> min ) ; $ this -> max = max ( $ this -> max , $ other -> max ) ; $ this -> n = $ n ; }
Merge another RunningStat instance into this instance.

This instance then has the state it would have had if all the data had
been accumulated by it alone.

@param RunningStat $other RunningStat instance to merge into this one
Merge another RunningStat instance into this instance .