Probability with R
Реклама. ООО «ЛитРес», ИНН: 7719571260.
Оглавление
Jane M. Horgan. Probability with R
Table of Contents
List of Tables
List of Illustrations
Guide
Pages
Probability with R: An Introduction with Computer Science Applications
Copyright
Dedication
Preface to the Second Edition
Preface to the First Edition
Acknowledgments
About the Companion Website
1 Basics of R
1.1 What Is R?
1.2 Installing R
1.3 R Documentation
1.4 Basics
1.5 Getting Help
1.6 Data Entry
1.6.1 Reading and Displaying Data on Screen
Example 1.1 Entering data from the screen to a vector
1.6.2 Reading Data from a File to a Data Frame
Definition 1.1 Data frame
Example 1.2 Reading data from a file into a data frame
1.7 Missing Values
1.8 Editing
1.8.1 Data Editing
1.8.2 Command Editing
1.9 Tidying Up
1.10 Saving and Retrieving
1.11 Packages
1.12 Interfaces
1.12.1 RStudio
1.12.2 R Commander
Exercises 1.1
1.13 Project
Reference
2 Summarizing Statistical Data
2.1 Measures of Central Tendency
Example 2.1 Apps Usage
2.2 Measures of Dispersion
2.3 Overall Summary Statistics
2.4 Programming in R
2.4.1 Creating Functions
Example 2.2 A program to calculate skewness
2.4.2 Scripts
Exercises 2.1
2.5 Project
3 Graphical Displays
3.1 BOXPLOTS
3.2 HISTOGRAMS
3.3 STEM AND LEAF
3.4 SCATTER PLOTS
3.5 THE LINE OF BEST FIT
3.6 MACHINE LEARNING AND THE LINE OF BEST FIT
Example 3.1
3.7 GRAPHICAL DISPLAYS VERSUS SUMMARY STATISTICS
Exercises 3.1
3.8 Projects
References
4 Probability Basics
4.1 Experiments, Sample Spaces, and Events
Example 4.1
Example 4.2
Example 4.3
Example 4.4
Example 4.5
Example 4.6
Example 4.7
Example 4.8
Example 4.9
Example 4.10
Example 4.11
4.1.1 Types of Sample Spaces
Exercises 4.1
4.2 Classical Approach to Probability
Definition 4.1 Classical Probability
Example 4.12
Example 4.13
Example 4.14
4.3 Permutations and Combinations
4.3.1 Permutations. Example 4.15
Example 4.16
Definition 4.2 Permutations
Example 4.17
Solution
4.3.2 Combinations
Example 4.18
Definition 4.3 Combinations
Example 4.19
4.4 The Birthday Problem
Example 4.20 The Birthday Paradox
4.4.1 A Program to Calculate the Birthday Probabilities
4.4.2 R Functions for the Birthday Problem
4.5 Balls and Bins
Example 4.21
4.6 R Functions for Allocation
Example 4.22
Example 4.23
4.7 Allocation Overload
Example 4.24
Solution
4.8 Relative Frequency Approach to Probability
Definition 4.4
4.9 Simulating Probabilities
Example 4.25
Example 4.26
Exercises 4.2
4.10 Projects
Recommended Reading
5 Rules of Probability
5.1 Probability and Sets
5.2 Mutually Exclusive Events
5.3 Complementary Events
5.4 Axioms of Probability
5.5 Properties of Probability
Property 1 Complementary events
Proof
Property 2 The empty set
Proof
Property 3 Monotonicity
Proof
Property 4 Probability between 0 and 1
Proof
Property 5 The addition law of probability
Proof
Example 5.1
Example 5.2
Example 5.3
Example 5.4
Solution
Exercises 5.1
Supplementary Reading
6 Conditional Probability
Definition 6.1 Conditional probability
Example 6.1
6.1 Multiplication Law of Probability
6.2 Independent Events
6.2.1 Independence of Two Events. Definition 6.2 Independence of two events
Example 6.2
Example 6.3
6.3 Independence of More than Two Events
Definition 6.3 Pairwise independence of more than two events
Definition 6.4 Mutual Independence of more than two events
Example 6.4
Example 6.5
6.4 The Intel FIASCO
6.5 Law of Total Probability
Example 6.6
Theorem 6.1 Law of total probability
Proof
6.6 Trees
Example 6.7
Example 6.8
Exercises 6.1
6.7 Project
Note
7 Posterior Probability and Bayes
7.1 Bayes' Rule. 7.1.1 Bayes' Rule for Two Events
Example 7.1
Solution
7.1.2 Bayes' Rule for More Than Two Events
Theorem 7.1 Bayes' rule
Proof
Example 7.2 The game problem (with apologies to Marilyn, Monty Hall and Let's Make a Deal)
7.2 Hardware Fault Diagnosis
Example 7.3
7.3 Machine Learning and Classification
7.3.1 Two‐Case Classification
Example 7.4
7.3.2 Multi‐case Classification
Example 7.5
7.4 Spam Filtering
Example 7.6
Solution
7.5 Machine Translation
Exercises 7.1
Reference
8 Reliability
8.1 Series Systems. Definition 8.1 Series systems
8.2 Parallel Systems. Definition 8.2 Parallel systems
8.3 Reliability of a System
8.3.1 Reliability of a Series System
Example 8.1
Example 8.2
Example 8.3
Solution
8.3.2 Reliability of a Parallel System
Example 8.4
Solution
Example 8.5
8.4 Series–Parallel Systems
Example 8.6
Example 8.7
8.5 The Design of Systems
Example 8.8
Example 8.9
Example 8.10
Example 8.11
8.6 The General System
Exercises 8.1
9 Introduction to Discrete Distributions
9.1 Discrete Random Variables
Definition 9.1 Discrete distributions
Example 9.1 Toss a fair coin
Example 9.2 Tossing two fair coins
Example 9.3 Draw a card from a deck
Example 9.4 Roll a fair die
Example 9.5
Example 9.6
Definition 9.2 Probability density function (pdf)
9.2 Cumulative Distribution Function
Definition 9.3 Cumulative distribution function (cdf)
Example 9.7
9.3 Some Simple Discrete Distributions. 9.3.1 The Bernoulli Distribution
Example 9.8
Example 9.9
Example 9.10
Example 9.11
Definition 9.4 The Bernoulli random variable
9.3.2 Discrete Uniform Distribution
Example 9.12
Example 9.13
Example 9.14
Definition 9.5 Uniform discrete random variable
Example 9.15
9.4 Benford's Law
9.5 Summarizing Random Variables: Expectation
9.5.1 Expected Value of a Discrete Random Variable
Example 9.16
Definition 9.6 Mean of a discrete random variable
Example 9.17
9.5.2 Measuring the Spread of a Discrete Random Variable
Definition 9.7 Variance of a discrete random variable
Example 9.18
Example 9.19
9.6 Properties of Expectations
Example 9.20
9.7 Simulating Discrete Random Variables and Expectations
9.8 Bivariate Distributions
Example 9.21
Example 9.22
Example 9.23
Definition 9.8 Probability density function of a bivariate random variable
9.9 Marginal Distributions. Definition 9.9 Marginal distribution of a random variable
9.10 Conditional Distributions. Definition 9.10 The conditional distribution of a random variable
Definition 9.11 Independence
Exercises 9.1
9.11 Project
References
10 The Geometric Distribution. Example 10.1
Example 10.2
Example 10.3
Example 10.4
10.1 GEOMETRIC RANDOM VARIABLES. Definition 10.1 Geometric random variable
10.1.1 Probability Density Function
Example 10.5
Example 10.6
Example 10.7
10.1.2 Calculating Geometric pdfs in R
10.2 CUMULATIVE DISTRIBUTION FUNCTION
Example 10.8
10.2.1 Calculating Geometric cdfs in R
10.3 THE QUANTILE FUNCTION
10.4 GEOMETRIC EXPECTATIONS
10.5 SIMULATING GEOMETRIC PROBABILITIES AND EXPECTATIONS
Example 10.9
10.6 AMNESIA
Example 10.10
Theorem 10.1 The Markov property of the geometric distribution
Example 10.11
Proof of Markov's property
Example 10.12
Solution
10.7 SIMULATING MARKOV
Exercises 10.1
10.8 PROJECTS
11 The Binomial Distribution. Example 11.1
Example 11.2
Example 11.3
Example 11.4
11.1 Binomial Probabilities
11.2 Binomial Random Variables. Definition 11.1 Binomial random variable
11.2.1 Calculating Binomial pdfs with R
11.2.2 Plotting Binomial pdfs in R
11.3 Cumulative Distribution Function
11.3.1 Calculating Binomial cdfs in R
11.3.2 Plotting cdfs in R
11.4 The Quantile Function
Example 11.5
Example 11.6
11.5 Reliability: The General System
Example 11.7
Example 11.8
11.5.1 The Series–Parallel General System
Example 11.9
Solution
Example 11.10
11.6 Machine Learning
Example 11.11
11.7 Binomial Expectations
11.7.1 Mean of the Binomial Distribution
Example 11.12
11.7.2 Variance of the Binomial Distribution
11.8 Simulating Binomial Probabilities and Expectations
11.8.1 Simulated Mean and Variance
Exercises 11.1
11.9 Projects
12 The Hypergeometric Distribution. Example 12.1
Example 12.2
Example 12.3
Example 12.4
12.1 Hypergeometric Random Variables. Definition 12.1 Hypergeometric random variable
12.1.1 Calculating Hypergeometric Probabilities with R
12.1.2 Plotting the Hypergeometric Function
12.2 Cumulative Distribution Function
12.3 The Lottery
12.3.1 Winning Something
12.3.2 Winning the Jackpot
12.4 Hypergeometric or Binomial? Example 12.5
Exercises 12.1
12.5 Projects
13 The Poisson Distribution
13.1 Death by Horse Kick
13.2 Limiting Binomial Distribution
Example 13.1
Example 13.2
13.3 Random Events in Time and Space
Example 13.3
Example 13.4
Example 13.5
Example 13.6
13.4 Probability Density Function
Example 13.7
13.4.1 Calculating Poisson pdfs with R
13.4.2 Plotting Poisson pdfs with R
13.5 Cumulative Distribution Function
13.5.1 Calculating Poisson cdfs in R
13.5.2 Plotting Poisson cdfs
13.6 The Quantile Function
Example 13.8
13.7 Estimating Software Reliability
Example 13.9
13.8 Modeling Defects In Integrated Circuits
Example 13.10
13.9 Simulating Poisson Probabilities
Exercises 13.1
13.10 Projects
References
14 Sampling Inspection Schemes. 14.1 Introduction
14.2 Single Sampling Inspection Schemes. Example 14.1
Example 14.2
Example 14.3
14.3 Acceptance Probabilities
14.4 Simulating Sampling Inspection Schemes
14.5 Operating Characteristic Curve
14.6 Producer's and Consumer's Risks
14.7 Design of Sampling Schemes
14.7.1 Choosing
Example 14.4
14.7.2 0/1 Inspection Schemes
Example 14.5
Example 14.6
14.7.3 Deciding on and Simultaneously. Example 14.7
14.8 Rectifying Sampling Inspection Schemes
14.9 Average Outgoing Quality
14.10 Double Sampling Inspection Schemes. Example 14.8
14.11 Average Sample Size
14.12 Single Versus Double Schemes
Exercises 14.1
14.13 Projects
15 Introduction to Continuous Distributions
15.1 Introduction to Continuous Random Variables. Definition 15.1 Continuous random variables
15.2 Probability Density Function
Example 15.1
15.3 Cumulative Distribution Function
Definition 15.2 Cumulative distribution function
Example 15.2
15.4 The Uniform Distribution
Definition 15.3 Continuous uniform distribution
Example 15.3
15.5 Expectation of a Continuous Random Variable
15.5.1 Mean and Variance of a Uniform Distribution
15.5.2 Properties of Expectations
15.6 Simulating Continuous Variables
15.6.1 Simulating the Uniform Distribution
Exercises 15.1
16 The Exponential Distribution. 16.1 Modeling Waiting Times. Example 16.1
Example 16.2
Example 16.3
Example 16.4
16.2 Probability Density Function of Waiting Times
Definition 16.1 The exponential random variable
16.3 Cumulative Distribution Function
16.4 Modeling Lifetimes
Example 16.5
Example 16.6
16.5 Quantiles
Example 16.7
16.6 Exponential Expectations
16.7 Simulating Exponential Probabilities and Expectations
16.7.1 Simulating Job Submissions
16.7.2 Simulating Lifetimes
16.8 Amnesia
Theorem 16.1 The Markov property of the exponential distribution
Proof
Example 16.8
Example 16.9
Solution
16.9 Simulating Markov
16.9.1 When Does Markov Not Hold?
Exercises 16.1
16.10 Project
17 Queues
17.1 The Single Server Queue
17.2 Traffic Intensity
17.3 Queue Length
Example 17.1
17.3.1 Queue Length with Traffic Intensity 1
17.3.2 Queue Length when the Traffic Intensity = 1
17.3.3 Queue Length with Traffic Intensity 1
17.4 Average Response Time. Definition 17.1 Average response time (ART)
17.5 Extensions of the M/M/1 Queue
Example 17.2
Exercises 17.1
17.6 Project
Reference
Notes
18 The Normal Distribution
18.1 The Normal Probability Density Function. Definition 18.1 Normal distribution
18.1.1 Graphing Normal Curves in R
18.2 The Cumulative Distribution Function
Example 18.1
18.2.1 Conditional Probabilities. Example 18.2
Example 18.3
18.3 Quantiles
18.4 The Standard Normal Distribution
18.5 Achieving Normality: Limiting Distributions
18.5.1 Normal Approximation to the Binomial
18.5.2 The Normal Approximation to the Poisson Distribution
Example 18.4
18.5.3 The Central Limit Theorem
Exercises 18.1
18.6 Projects
19 Process Control
19.1 Control Charts
Example 19.1
19.2 Cusum Charts
19.3 Charts for Defective Rates
Example 19.2
Example 19.3
Exercises 19.1
19.4 Project
20 The Inequalities of Markov and Chebyshev
20.1 Markov's Inequality
Example 20.1
Theorem 20.1 Markov's inequality
Proof of Markov's Inequality
Example 20.2
Solution
Example 20.3
Solution
Example 20.4
Solution
20.2 Algorithm Runtime
Example 20.5
20.3 Chebyshev's Inequality
Theorem 20.2 Chebyshev's inequality
Example 20.6
Example 20.7
Proof of Chebyshev's Inequality
Example 20.8
Solution
20.1 Exercises 20.1
Appendix A Data: Examination Results
Appendix B The Line of Best Fit: Coefficient Derivations
Appendix C Variance Derivations
C.1 Variance of the Geometric Distribution (Chapter 10)
C.2 Variance of the Binomial Distribution (Chapter 11)
C.3 Variance of the Poisson Distribution (Chapter 13)
C.4 Variance of the Uniform Distribution (Chapter 15)
C.5 Variance of the Exponential Distribution (Chapter 16)
Appendix D Binomial Approximation to the Hypergeometric
Appendix E Normal Tables
Appendix F The Inequalities of Markov and Chebyshev. F.1 Markov's Inequality: A Proof Without Words
F.2 Chebyshev's Inequality: Markov's in Disguise
Index to R Commands
Index
Postface
WILEY END USER LICENSE AGREEMENT
Отрывок из книги
Second Edition
Jane M. Horgan
.....
While we could list the entire data frame on the screen, this is inconvenient for all but the smallest data sets. R provides facilities for listing the first few rows and the last few rows.
head(results, n = 4)
.....