# pdf 関数

ある点における分布の密度、または離散分布における値の確率。

## 書き方

### pdf(distribution, x)

密度、または離散分布における整数の確率。

**distribution**

normal_distribution(0, 1) のような分布。式を受け取ります。

**x**

点、または値。式を受け取ります。

### pdf(process, y)

ある時刻における確率過程の密度。

**process**

ある時刻の過程。construct(p, t) と書く。保存された過程 p なら p(t)。式を受け取ります。

**y**

過程の値。式を受け取ります。

## 例題

- $\displaystyle f_{X}(x),\ X \sim \mathcal{N}(0, 1) = \frac{\sqrt{2}}{2 \sqrt{\pi} e^{\frac{x^{2}}{2}}}$

  `pdf(normal_distribution(0, 1), x)`

  ソルバーでは、`pdf(normal_distribution(0, 1), x)` の答えは `(1/2)sqrt(2)*e^(-x^2/2)/sqrt(pi)` です。

  [ソルバーで開く](https://ja.hilberon.com/?q=pdf%28normal_distribution%280%2C%201%29%2C%20x%29)
- $\displaystyle f_{X}(2),\ X \sim \mathrm{B}\left(5, \frac{1}{3}\right) = \frac{80}{243}$

  `pdf(binomial_distribution(5, 1/3), 2)`

  ソルバーでは、`pdf(binomial_distribution(5, 1/3), 2)` の答えは `80/243` です。

  [ソルバーで開く](https://ja.hilberon.com/?q=pdf%28binomial_distribution%285%2C%201%2F3%29%2C%202%29)
- $\displaystyle \operatorname{pdf}(\operatorname{construct}(\operatorname{OU}(\mu, \sigma, \theta, x_{0}), t), y) = \begin{cases} \frac{\sqrt{2}}{2 e^{\frac{\left(y-\left(\frac{x_{0}-\mu}{e^{t \theta}}+\mu\right)\right)^{2}}{2 \left(\frac{\sigma^{2}}{2 \theta}-\frac{\sigma^{2}}{2 \theta e^{2 t \theta}}\right)}} \sqrt{\pi \left(\frac{\sigma^{2}}{2 \theta}-\frac{\sigma^{2}}{2 \theta e^{2 t \theta}}\right)}} & \text{if } \theta \neq 0 \end{cases}$

  `pdf(construct(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t), y)`

  ソルバーでは、`pdf(construct(ornstein_uhlenbeck_process(mu, sigma, theta, x0), t), y)` の答えは `(1/2)sqrt(2)*e^((-1/2)*(y - (e^(-t*theta)*(x0 - mu) + mu))^2/((1/2)sigma^2/theta - (1/2)sigma^2*e^(-2t*theta)/theta))/sqrt(pi*((1/2)sigma^2/theta - (1/2)sigma^2*e^(-2t*theta)/theta)) if theta != 0` です。

  [ソルバーで開く](https://ja.hilberon.com/?q=pdf%28construct%28ornstein_uhlenbeck_process%28mu%2C%20sigma%2C%20theta%2C%20x0%29%2C%20t%29%2C%20y%29)

## 例題で使っている関数

- [normal_distribution](https://ja.hilberon.com/library/normal_distribution)

  平均 mu、標準偏差 sigma の正規分布。
- [binomial_distribution](https://ja.hilberon.com/library/binomial_distribution)

  n回の独立な試行のうち成功する回数。各試行は確率pで成功します。
- [construct](https://ja.hilberon.com/library/construct)

  それ自体が計算される頭部を引数に適用します。例えば f'(0) や (x => body)(a) のように。
- [ornstein_uhlenbeck_process](https://ja.hilberon.com/library/ornstein_uhlenbeck_process)

  mu に向かって率 theta で引き戻され、ノイズ sigma をもち、x0 から始まる過程。

## 関連する関数

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

  平均率 lambda で起こる事象の、ある期間における個数。
- [probability](https://ja.hilberon.com/library/probability)

  変数にある分布があるとき、条件が成り立つ確率。
- [quantile](https://ja.hilberon.com/library/quantile)

  リストの少なくとも割合q、または分布の確率qがその値以下になる最小の値です。
- [mode](https://ja.hilberon.com/library/mode)

  リストの中で最も頻繁な値。同数が複数あるときはそのリスト。
- [standard_deviation](https://ja.hilberon.com/library/standard_deviation)

  数のリストの標本標準偏差、または分布の標準偏差。
- [median](https://ja.hilberon.com/library/median)

  数のリストの中央の値、または中央の2つの平均です。

---
Source: https://ja.hilberon.com/library/pdf
