Tensor.stdDev
- Tensor.stdDev()
Compute the standard deviation of a univariate numerical discrete distribution.
- Raises:
pyagrum.ArgumentError – If the tensor is not a 1-dimensional distribution (sum != 1) or if the variable is not numerical.
- Returns:
the standard deviation of the distribution
- Return type:
float
Example
import pyagrum as gum
x = gum.fastVariable("x{1|2|4}")
p = gum.Tensor().add(x).fillWith([0.2, 0.5, 0.3])
round(p.stdDev(), 4)
# 1.1136
Class