class_docstr: Covariance.
  
  Parameters
  ----------
  ddof
      Delta Degrees of Freedom.
  
  Examples
  --------
  
  >>> from river import stats
  
  >>> x = [-2.1,  -1,  4.3]
  >>> y = [   3, 1.1, 0.12]
  
  >>> cov = stats.Cov()
  
  >>> for xi, yi in zip(x, y):
  ...     cov.update(xi, yi)
  ...     print(cov.get())
  0.0
  -1.044999
  -4.286
  
  This class has a `revert` method, and can thus be wrapped by `utils.Rolling`:
  
  >>> from river import utils
  
  >>> x = [-2.1,  -1, 4.3, 1, -2.1,  -1, 4.3]
  >>> y = [   3, 1.1, .12, 1,    3, 1.1, .12]
  
  >>> rcov = utils.Rolling(stats.Cov(), window_size=3)
  
  >>> for xi, yi in zip(x, y):
  ...     rcov.update(xi, yi)
  ...     print(rcov.get())
  0.0
  -1.045
  -4.286
  -1.382
  -4.589
  -1.415
  -4.286
  
  Notes
  -----
  The outcomes of the incremental and parallel updates are consistent with numpy's
  batch processing when $\text{ddof} \le 1$.
  
  References
  ----------
  [^1]: [Wikipedia article on algorithms for calculating variance](https://www.wikiwand.com/en/Algorithms_for_calculating_variance#/Covariance)
  [^2]: Schubert, E. and Gertz, M., 2018, July. Numerically stable parallel computation of
  (co-) variance. In Proceedings of the 30th International Conference on Scientific and
  Statistical Database Management (pp. 1-12).
class_docstr_tok: ["Covariance",".","Parameters","--","--","--","--","--","ddof","Delta","Degrees","of","Freedom",".","Examples","--","--","--","--",">",">",">","from","river","import","stats",">",">",">","x","=","[","-2.1",",","-1",",","4.3","]",">",">",">","y","=","[","3",",","1.1",",","0.12","]",">",">",">","cov","=","stats.Cov","(",")",">",">",">","for","xi",",","yi","in","zip","(","x",",","y",")",":","...","cov.update","(","xi",",","yi",")","...","print","(","cov.get","(",")",")","0.0","-1.044999","-4.286","This","class","has","a","`","revert","`","method",",","and","can","thus","be","wrapped","by","`","utils.Rolling","`",":",">",">",">","from","river","import","utils",">",">",">","x","=","[","-2.1",",","-1",",","4.3",",","1",",","-2.1",",","-1",",","4.3","]",">",">",">","y","=","[","3",",","1.1",",",".12",",","1",",","3",",","1.1",",",".12","]",">",">",">","rcov","=","utils.Rolling","(","stats.Cov","(",")",",","window_size=3",")",">",">",">","for","xi",",","yi","in","zip","(","x",",","y",")",":","...","rcov.update","(","xi",",","yi",")","...","print","(","rcov.get","(",")",")","0.0","-1.045","-4.286","-1.382","-4.589","-1.415","-4.286","Notes","--","--","-","The","outcomes","of","the","incremental","and","parallel","updates","are","consistent","with","numpy's","batch","processing","when","$","\\text","{","ddof","}","\\le","1","$",".","References","--","--","--","--","--","[","^1","]",":","[","Wikipedia","article","on","algorithms","for","calculating","variance","]","(","https",":","\/\/www.wikiwand.com\/en\/Algorithms_for_calculating_variance","#","\/Covariance",")","[","^2","]",":","Schubert",",","E.","and","Gertz",",","M.",",","2018",",","July",".","Numerically","stable","parallel","computation","of","(","co-",")","variance",".","In","Proceedings","of","the","30th","International","Conference","on","Scientific","and","Statistical","Database","Management","(","pp",".","1-12",")","."]
code: def __init__(self, ddof=1):
      self.ddof = ddof
      self.mean_x = stats.Mean()
      self.mean_y = stats.Mean()
      self.cov = 0
  
file_path: river/river/stats/cov.py
imports: from __future__ import annotations
  import copy
  import numpy
  from river import stats
label_desc: Use image node_id 1 to create a new Cov object from inherited base classes: stats.base with example: obj = Cov(ddof)