Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to pass in the transpose, you'll need to set <code>rowvar</code> to zero.</p> <pre><code>In [10]: np.cov(someVec, rowvar=0) Out[10]: array(1.5833333333333333) In [11]: np.cov(someVec.T, rowvar=0) Out[11]: array(1.5833333333333333) </code></pre> <p>From the <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.cov.html" rel="nofollow">docs</a>:</p> <blockquote> <p><strong>rowvar</strong> : int, optional </p> <p>If rowvar is non-zero (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations.</p> </blockquote> <p>If you want to find a full covariance matrix, you'll need more than one observation. With a single observation, and numpy's default estimator, <code>NaN</code> is exactly what you'd expect. If you would like to have normalization done by <code>N</code> instead of <code>(N-1)</code>, you can pass in a <code>1</code> to the bias. </p> <pre><code>In [12]: np.cov(someVec.T, bias=1) Out[12]: array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.]]) </code></pre> <p>Again, from the docs.</p> <blockquote> <p><strong>bias</strong> : int, optional </p> <p>Default normalization is by (N - 1), where N is the number of observations given (unbiased estimate). If bias is 1, then normalization is by N. These values can be overridden by using the keyword ddof in numpy versions >= 1.5.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload