# 标准差（Standard deviation，standard_deviation）

一组数的样本标准差，或分布的标准差。

## 怎么写

### standard_deviation(data)

样本方差的平方根，除以 n - 1。

**data**

至少两个数。允许符号。接受一个列表。

### standard_deviation(distribution)

分布方差的平方根。

**distribution**

分布，如 normal_distribution(mu, sigma)。接受一个表达式。

### standard_deviation(process)

随机过程在某一时刻的方差的平方根。

**process**

某一时刻的过程，写作 construct(p, t)，或对已存储的过程 p 写作 p(t)。接受一个表达式。

## 示例

- $\displaystyle 2, 4, 4, 4, 5, 5, 7, 9 = \frac{4 \sqrt{14}}{7}$

  `standard_deviation([2, 4, 4, 4, 5, 5, 7, 9])`

  在求解器中，`standard_deviation([2, 4, 4, 4, 5, 5, 7, 9])` 的结果是 `4sqrt(14)/7`。

  [在求解器中打开](https://zh.hilberon.com/?q=standard_deviation%28%5B2%2C%204%2C%204%2C%204%2C%205%2C%205%2C%207%2C%209%5D%29)
- $\displaystyle \sigma_{X},\ X \sim \mathrm{Pois}(\lambda) = \sqrt{\lambda}$

  `standard_deviation(poisson_distribution(lambda))`

  在求解器中，`standard_deviation(poisson_distribution(lambda))` 的结果是 `sqrt(lambda)`。

  [在求解器中打开](https://zh.hilberon.com/?q=standard_deviation%28poisson_distribution%28lambda%29%29)
- $\displaystyle \sigma_{X},\ X \sim \mathrm{Exp}(\lambda) = \frac{1}{\lambda}$

  `standard_deviation(exponential_distribution(lambda))`

  在求解器中，`standard_deviation(exponential_distribution(lambda))` 的结果是 `1/lambda`。

  [在求解器中打开](https://zh.hilberon.com/?q=standard_deviation%28exponential_distribution%28lambda%29%29)
- $\displaystyle \operatorname{construct}(\operatorname{OU}(\mu, \sigma, \theta, x_{0}), t) = \begin{cases} \frac{\sqrt{2} \sqrt{\frac{\sigma^{2} \left(1-\frac{1}{e^{2 t \theta}}\right)}{\theta}}}{2} & \text{if } \theta \neq 0 \end{cases}$

  `standard_deviation(construct(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t))`

  在求解器中，`standard_deviation(construct(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t))` 的结果是 `sqrt(2)*sqrt(sigma^2*(1 - e^(-2t*theta))/theta)/2 if theta != 0`。

  [在求解器中打开](https://zh.hilberon.com/?q=standard_deviation%28construct%28ornstein_uhlenbeck_process%28mu%2C%20sigma%2C%20theta%2C%20x0%29%2C%20t%29%29)

## 示例中用到的函数

- [poisson_distribution](https://zh.hilberon.com/library/poisson_distribution)

  在一段时间内以平均速率 lambda 发生的事件的次数。
- [exponential_distribution](https://zh.hilberon.com/library/exponential_distribution)

  以速率 lambda 发生的事件的等待时间。
- [construct](https://zh.hilberon.com/library/construct)

  把本身是计算得到的头部作用于参数，例如 f'(0) 或 (x => body)(a)。
- [ornstein_uhlenbeck_process](https://zh.hilberon.com/library/ornstein_uhlenbeck_process)

  以速率 theta 被拉向 mu、噪声为 sigma、从 x0 开始的随机过程。

## 相关函数

- [stationary_distribution](https://zh.hilberon.com/library/stationary_distribution)

  过程随时间趋于的分布，若存在的话。
- [quantile](https://zh.hilberon.com/library/quantile)

  列表中至少有占比 q 的数据不超过的最小值，或分布中变量以概率 q 不超过的值。
- [uniform_distribution](https://zh.hilberon.com/library/uniform_distribution)

  在 a 与 b 之间任何位置等可能的连续分布。
- [probability](https://zh.hilberon.com/library/probability)

  带分布的变量满足某个条件的概率。
- [variance](https://zh.hilberon.com/library/variance)

  一组数的样本方差，或一个分布的方差。
- [weibull_distribution](https://zh.hilberon.com/library/weibull_distribution)

  一个单元存活到时间 x 的概率为 e^(-(x/scale)^shape) 时的寿命。

---
Source: https://zh.hilberon.com/library/standard_deviation
