SlideShare a Scribd company logo
1 of 35
チョコボールのエンゼル
出現確率をベイズ推定す
る
統計楽しまNight!! データマイニングMeet up #3
@yoichi_t
自己紹介
• @yoichi_t
• “AIベンチャー”と言われる企業で
ソフトウェアエンジニア+コンサルタントやってます
• LT初めて(ドキドキ)
※間違っている部分はご指摘いただけると嬉しいです
頻度主義
ベイズ主義
vs
 森永製菓
 1個¥80くらい
 最近サクッと感が増し
た(気がする)
銀なら5枚で
金なら1枚で
おもちゃのカンヅメが
もらえる!
中身はしょうもない楽しいおもちゃが入ってるよ
何個買ったら
エンゼルが当たる?
先行研究1
開封数
•1,000個
金の数
•1個
予測確率
•0.10%
チョコボール 金 確率
先行研究2
開封数
•1,000個
金の数
•2個
予測確率
•0.20%
チョコボール 金 確率
ブレブレじゃん
頻度(最尤推定)
• エンゼルが当たるか当たらないかを事象とした二項分布の最尤
推定量
• 多数のデータがあれば推定量は真値に近づいていく
(大数の法則)
• データが少なければ当然ブレる
稀な現象に頻度を適用すると危険
• 工場にある装置の異常発生率を知りたい
• データを取ったら異常がなかった
• ということはこの機械は不良品を出さないってこと?
• とあるメディアに新規にバナー広告を出してみた
• たまたますぐにCVが計測
• このメディアに全予算つぎ込め⁉︎
曖昧さを
含めた予測
ベイズ推定
点推定と分布推定
(頻度主義とベイズ主義)
点推定
• 予測値をある決まった
値で出力
• よくある推定方法
• 計算が楽
分布推定
• 複数の予測値の確信度
を予測(この値になる
のはこのくらい)
• ベイズ推定
• 計算がややこしい
※頻度主義の立場でも区間推定など曖昧さを表現する方法は当然あるよ
点推定と分布推定
(頻度主義とベイズ主義)
点推定
• 予測値をある決まった
値で出力
• よくある推定方法
• 計算が楽
分布推定
• 複数の予測値の確信度
を予測(この値になる
のはこのくらい)
• ベイズ推定
• 計算がややこしい
y%
予測値はy%!
※頻度主義の立場でも区間推定など曖昧さを表現する方法は当然あるよ
点推定と分布推定
(頻度主義とベイズ主義)
点推定
• 予測値をある決まった
値で出力
• よくある推定方法
• 計算が楽
分布推定
• 複数の予測値の確信度
を予測(この値になる
のはこのくらい)
• ベイズ推定
• 計算がややこしい
x% y% z%
予測値は
x%~z%の間
予測値はy%!
※頻度主義の立場でも区間推定など曖昧さを表現する方法は当然あるよ
やってみよう!
理論的な部分は省略します(LTだし)
モデル
𝑝 𝜃|𝑋 =
𝑝 𝑋|𝜃 𝑝 𝜃
𝑝 𝑋
θ:エンゼル出現確率
X:データ
ポアソン分布 一様分布
全体の計算はMCMCで
近似計算
問題設定
•データ(自腹)
項目 数
計測データ数 121
銀のエンゼル出現数 7
金のエンゼル出現数 0
銀のエンゼルの出現確率予測
確率
銀のエンゼルの出現確率予測
最尤推定量:5.8%
確率
銀のエンゼルの出現確率予測
最尤推定量
ベイズ90%信用区間:
3.5%~10.4%
確率
何個買えばエンゼルが5個当たる?
• 負の二項分布の累積確率で予測
𝑓 𝑥, 𝑘; 𝜃 =
𝑘 + 𝑥 − 1
𝑥
𝜃 𝑘
1 − 𝜃 𝑥
k:成功数
x:k回成功するまでの失敗回数
この分布が予測できている
期待値を計算
𝑓 𝑥, 𝑘|𝐷 = 𝑝 𝜃|𝐷
𝑘 + 𝑥 − 1
𝑥
𝜃 𝑘
1 − 𝜃 𝑥
何個買えばエンゼルが5個当たる?
•75箱買えば50%の確率で5個当たる!!
50%
70
金のエンゼルの出現確率予測
確率
金のエンゼルの出現確率予測
最尤推定量:0.0%
ベイズ90%信用区間:
0.04%~2.47%
確率
データが多ければ
• ベイズ推定の予測分布は最尤推定量に収束していく
• ベイズ推定はデータが少ない時、稀な現象のときにリスクを見
積もれる
• 頻度は計算が楽
詳しくはブログを参照ください
チョコボール 統計
他にはこんなこともやってます
正味の重量をベイズで予測
チョコボール数の変化点を捉える
(ベイズ推定)
チョコボールを画像認識して
数を自動カウントする

More Related Content

Recently uploaded

知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptxsn679259
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...Toru Tamaki
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルCRI Japan, Inc.
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Gamesatsushi061452
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video UnderstandingToru Tamaki
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイスCRI Japan, Inc.
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsWSO2
 

Recently uploaded (10)

知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

チョコボールのエンゼル出現確率をベイズ推定する

Editor's Notes

  1. 今日、お話する内容ですが、 統計分野における宗教戦争について聞いたことがありますか?
  2. 頻度主義とベイズ主義の闘争です または「古典統計」VS「ベイズ統計」という名前で聞いたことがあるかもしれません
  3. 唐突ですがチョコボールってご存知ですか?
  4. 概要 そんなことはどうでも良くて、
  5. エンゼルを集めておもちゃがもらえるのはわかった でも、おじさんは思うわけです
  6. それは人類に残された大きな課題
  7. おじさんは疑問に思うわけです。 1000個買えばいいの?500個買えばいいの? 「調査によってブレるじゃん」と はい。当然ブレます。 問題提起
  8. おじさんは疑問に思うわけです。 1000個買えばいいの?500個買えばいいの? 「調査によってブレるじゃん」と はい。当然ブレます。 問題提起
  9. このような考え方を「頻度」といって、よくある普通の推定手法です。
  10. 点推定と分布推定の話をする
  11. 点推定と分布推定の話をする
  12. 点推定と分布推定の話をする
  13. ベイ推定やってみよう
  14. 今日は数式や理論は全て取り払います。自分で実装したい方は詳しい人に聞いてください。 データ元は自腹です
  15. こうして分布が分かれば、幾何分布と合わせて期待値を計算することで、あと何個チョコボールを買えば銀のエンゼルが5枚集まるのか?を見積もることができる。
  16. こうして分布が分かれば、幾何分布と合わせて期待値を計算することで、あと何個チョコボールを買えば銀のエンゼルが5枚集まるのか?を見積もることができる。
  17. こうして分布が分かれば、幾何分布と合わせて期待値を計算することで、あと何個チョコボールを買えば銀のエンゼルが5枚集まるのか?を見積もることができる。
  18. 結局データが多ければ収束する先は同じ。 データの質や量で使いどころが変わる。 でも、正例が数千にたいして負例が数個といった稀な現象を扱う場合に、頻度を過信するとかなり危険よというお話でした。