Skip to Content
Rクックブック 第2版
book

Rクックブック 第2版

by J.D. Long, Paul Teetor, 大橋 真也, 木下 哲也
January 2020
Intermediate to advanced
584 pages
7h 18m
Japanese
O'Reilly Japan, Inc.
Content preview from Rクックブック 第2版

8章確率

確率論は統計学の基本です。Rには確率、確率分布、確率変数を扱うための仕組みがいくつも用意されています。本章のレシピでは、分位数から確率を求める方法、確率から分位数を求める方法、分布から取り出した確率変数の生成方法、分布のプロット方法などを紹介します。

分布の名前

Rではすべての確率分布に省略名があります。その分布に関連する関数を特定するのにこの名前を使います。例えば、正規分布の名前は「norm」で、表8-1の関数名のベースになっています。

表8-1 正規分布関数

関数目的
dnorm正規密度関数
pnorm正規分布関数
qnorm正規分布の分位関数†1
rnorm正規乱数

[†1] 訳注:分布関数の逆。

表8-2に一般的な離散分布を、表8-3に一般的な連続分布をまとめました。

表8-2 一般的な離散分布

離散分布R上の名前パラメータ
二項分布binomn=試行回数、p=1回の試行での成功の確率
幾何分布geomp=1回の試行での成功の確率
超幾何分布hyperm=壺(urn)内の白玉の数、n=壺内の黒玉の数、k=壺から取り出した玉の数
負の二項(NegBinomial)分布nbinomsize=成功試行の数、prob=成功試行の確率またはmu=平均
ポアソン分布poislambda=平均

表8-3 一般的な連続分布

連続分布R上の名前パラメータ
ベータ分布betashape1shape2
コーシー分布cauchylocationscale
カイ二乗(Chisquare)分布chisqdf=自由度
指数分布exprate
F分布fdf1df2=自由度
ガンマ分布gammarateまたはscale
対数正規(Lognormal)分布lnormmeanlog ...
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

Rクイックリファレンス 第2版

Rクイックリファレンス 第2版

Joseph Adler, 大橋 真也, 木下 哲也
ハイパフォーマンスPython 第2版

ハイパフォーマンスPython 第2版

Micha Gorelick, Ian Ozsvald, 中山 光樹
Rではじめるデータサイエンス 第2版

Rではじめるデータサイエンス 第2版

Hadley Wickham, Mine Çetinkaya-Rundel, Garrett Grolemund, 大橋 真也
Rではじめるデータサイエンス

Rではじめるデータサイエンス

Hadley Wickham, Garrett Grolemund, 黒川 利明, 大橋 真也

Publisher Resources

ISBN: 9784873118857Other