LoginSignup
2
3

More than 5 years have passed since last update.

Pythonでサンプリングデータから確率分布関数を作るには

Last updated at Posted at 2017-07-03

サンプリングデータから確率分布関数を作る

pmfについてヒストグラムを利用する方法とkdeでpdfを作りそれを利用する方法。
pdf: Probability Density Function
pmf: Probability Mass Function
kde: Kernel Density Estimation
gaussian_kdeをそのまま使う場合と共分散を指定する両方の方法の違いをグラフで示すことができた。pmfをpdfを利用して作り出す場合、データの分散を指定することでなめらかな関数ができあがる。
例の場合は整数値なのでデータの離散幅は1である。
従ってσを0.5とし分散σ2を0.25としたものにした。

簡単な例をJupyter notebookで書きました。
以下のGistで公開しています。
https://gist.github.com/koki-ogura/48542f55b631847989b537ceb1b16115

ソースは以下のgithubで公開しています。
https://github.com/koki-ogura/probability_basis

2
3
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
2
3