> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 母分散を計算します。

# varPop

<h2 id="varPop">
  varPop
</h2>

導入バージョン: v1.1.0

母分散を計算します。

母分散は次の式で計算されます：

$$
\frac{\Sigma{(x - \bar{x})^2}}{n}
$$

<br />

ここで：

* $x$ は母集団の各値
* $\bar{x}$ は母平均
* $n$ は母集団のサイズ

<Note>
  この関数は数値的に不安定なアルゴリズムを使用しています。計算に[数値安定性](https://en.wikipedia.org/wiki/Numerical_stability)が求められる場合は、[`varPopStable`](/reference/functions/aggregate-functions/varPopStable) 関数を使用してください。処理速度は遅くなりますが、計算誤差が小さくなります。
</Note>

**Syntax**

```sql theme={null}
varPop(x)
```

**別名**: `VAR_POP`

**引数**

* `x` — 母分散を求める値の母集団。[`(U)Int*`](/reference/data-types/int-uint) または [`Float*`](/reference/data-types/float) または [`Decimal*`](/reference/data-types/decimal)

**戻り値**

`x` の母分散を返します。[`Float64`](/reference/data-types/float)

**例**

**母分散の計算**

```sql title=Query theme={null}
DROP TABLE IF EXISTS test_data;
CREATE TABLE test_data
(
    x UInt8,
)
ENGINE = Memory;

INSERT INTO test_data VALUES (3), (3), (3), (4), (4), (5), (5), (7), (11), (15);

SELECT
    varPop(x) AS var_pop
FROM test_data;
```

```response title=Response theme={null}
┌─var_pop─┐
│    14.4 │
└─────────┘
```
