You are here

function Vector::std in Recommender API 6.2

Same name and namespace in other branches
  1. 7.6 classes/Matrix.php \Vector::std()
1 call to Vector::std()
Vector::correlation in ./Matrix.php
Compute correlation with $vector. No caching option. Works for RealVector. SparseVector needs additional handling.

File

./Matrix.php, line 236

Class

Vector
This is the Vector superclass. @author danithaca

Code

function std($may_cache = FALSE) {
  if (!$may_cache || $this->std === NULL) {

    // force calculation
    $variance = $this
      ->variance($may_cache);
    $this->std = is_nan($variance) ? NAN : sqrt($variance);
  }
  return $this->std;
}