LoginSignup
7
4

More than 5 years have passed since last update.

正規分布の検証

Posted at

これなに

データが、正規分布かどうかの検証を docker で簡単にできるようにしました。

使い方

ダミーデータでテストする場合

bash
python -c "import numpy; print(str(list(numpy.random.normal(size=100)))\
  .strip('[]'))" | docker run -i --rm tsutomu7/test_normal > test.htm
firefox test.htm

上記のようにすると、下記のように表示されます。

image

ファイル(data.csv)からテストする場合

bash
docker run -i --rm tsutomu7/test_normal < data.csv > test.htm
firefox test.htm

やっていること

  • データ数の確認(十分多いか)
  • ヒストグラム表示(釣り鐘型か)
  • QQプロット表示(直線上に並ぶか)
  • シャピロウィルク検定

下記のように一様分布を使うと、正規分布と判定されません。

bash
python -c "import numpy; print(str(list(numpy.random.random(size=1000)))\
  .strip('[]'))" | docker run -i --rm tsutomu7/test_normal > test.htm
firefox test.htm

以上

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4