Skip to Content
Think Stats 第3版 ―Pythonで学ぶ統計学入門
book

Think Stats 第3版 ―Pythonで学ぶ統計学入門

by Allen B. Downey, 大橋 真也
October 2025
Intermediate to advanced
328 pages
3h 56m
Japanese
O'Reilly Japan, Inc.
Content preview from Think Stats 第3版 ―Pythonで学ぶ統計学入門

3章確率質量関数

2章では、FreqTabオブジェクトを使って分布を表現しました。このオブジェクトは値の集合とその度数、つまり各値が現れる回数でできています。この章では、分布を記述する別の方法として、確率質量関数(PMF)を紹介します。

確率質量関数を表現するために、値の集合とその確率を含んだPmfと呼ばれるオブジェクトを使います。これは、値の集合とその確率を含んでいます。Pmfオブジェクトを使って、分布の平均値と分散、そして分布が左右どちらに歪んでいるかを示す歪度を計算します。最後に、「検査のパラドックス」と呼ばれる現象によって、標本自体が分布の偏った見方が生じる原因となることについて探ります。

3.1 確率質量関数

Pmfオブジェクトは、度数の代わりに確率を含むFreqTabのようなものです。したがって、Pmfを作成する1つの方法は、FreqTabから始めることです。例として、短いシーケンスにおける値の分布を表すFreqTabを以下に示します。

from empiricaldist import FreqTab

ftab = FreqTab.from_seq([1, 2, 2, 3, 5])
ftab
 度数
11
22
31
51

度数の和が元のシーケンスのサイズとなっています。

n = ftab.sum()
n
5

度数をnで割ると、回数ではなく割合を表します。

pmf = ftab / n
pmf
 確率
10.2
20.4
30.2
50.2

この結果は、シーケンス内の値の20%が1、40%が2、ということを示しています。

元のシーケンスからランダムな値を選ぶと、値1を選ぶ確率は0.2、値2を選ぶ確率は0.4、といった具合です。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

直感 生成AI ―ハンズオンで動かして学ぶ拡散モデル入門

直感 生成AI ―ハンズオンで動かして学ぶ拡散モデル入門

Omar Sanseviero, Pedro Cuenca, Apolinário Passos, Jonathan Whitaker, 江川 崇
SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム

SRE サイトリライアビリティエンジニアリング ―Googleの信頼性を支えるエンジニアリングチーム

Betsy Beyer, Chris Jones, Jennifer Petoff, Niall Richard Murphy, 澤田 武男, 関根 達夫, 細川 一茂, 矢吹 大輔, Sky株式会社 玉川 竜司
MLOps実装ガイド ―本番運用を見据えた開発戦略

MLOps実装ガイド ―本番運用を見据えた開発戦略

Yaron Haviv, Noah Gift, 井伊 篤彦, 入江 美穂, 張 凡, 樋口 千洋

Publisher Resources

ISBN: 9784814401376Publisher Website