Some (Pseudo-) Random Number Stuff in R

Slides:



Advertisements
Similar presentations
1 Chi-Square Test -- X 2 Test of Goodness of Fit.
Advertisements

Random variables 1. Note  there is no chapter in the textbook that corresponds to this topic 2.
1. Frequency Distribution & Relative Frequency Distribution 2. Histogram of Probability Distribution 3. Probability of an Event in Histogram 4. Random.
Ch. 17 The Expected Value & Standard Error Review of box models 1.Pigs – suppose there is a 40% chance of getting a “trotter”. Toss a pig 20 times. –What.
A.P. STATISTICS LESSON 7 – 1 ( DAY 1 ) DISCRETE AND CONTINUOUS RANDOM VARIABLES.
Biased Coins Or “Why I am considering buying 840 blank dice” Michael Gibson.
CSE 221: Probabilistic Analysis of Computer Systems Topics covered: Expectation of random variables Moments (Sec )
HEADS UP ON ENTROPY Statistics Project By Charles Cox and Maxcy Dimmick.
Section The Idea of Probability Statistics.
 The Law of Large Numbers – Read the preface to Chapter 7 on page 388 and be prepared to summarize the Law of Large Numbers.
Ch. 17 The Expected Value & Standard Error Review box models –Examples 1.Pigs – assume 40% chance of getting a “trotter” -20 tosses 2.Coin toss – 20 times.
Binomial & Geometric Random Variables §6-3. Goals: Binomial settings and binomial random variables Binomial probabilities Mean and standard deviation.
AP Statistics: Section 8.2 Geometric Probability.
1. Population Versus Sample 2. Statistic Versus Parameter 3. Mean (Average) of a Sample 4. Mean (Average) of a Population 5. Expected Value 6. Expected.
Statistics Frequency and Distribution. We interrupt this lecture for the following… Significant digits You should not report numbers with more significant.
14/6/1435 lecture 10 Lecture 9. The probability distribution for the discrete variable Satify the following conditions P(x)>= 0 for all x.
Unit 5 Section 5-4 – Day : The Binomial Distribution  The mean, variance, and standard deviation of a variable that has the binomial distribution.
Probability Distributions. Essential Question: What is a probability distribution and how is it displayed?
Math 15 – Elementary Statistics Sections 7.1 – 7.3 Probability – Who are the Frequentists?
OPIM 5103-Lecture #3 Jose M. Cruz Assistant Professor.
Basic Concepts of Probability Coach Bridges NOTES.
Sampling Error SAMPLING ERROR-SINGLE MEAN The difference between a value (a statistic) computed from a sample and the corresponding value (a parameter)
Discrete to Continuous In each step each bar in the histogram is split into two bars.
Psychology 202a Advanced Psychological Statistics September 22, 2015.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. Section 6-4 Sampling Distributions and Estimators.
Frequency and Histograms. Vocabulary:  Frequency: The number of data values in an interval.  Frequency Table: A table that groups a set of data values.
 I can identify the shape of a data distribution using statistics or charts.  I can make inferences about the population from the shape of a sample.
Simulation Discrete Variables. What is it? A mathematical model Probabilistic Uses the entire range of possible values of a variable in the model.
Section The Idea of Probability AP Statistics
Probability Distribution. Probability Distributions: Overview To understand probability distributions, it is important to understand variables and random.
PATTERN RECOGNITION LAB 2 TA : Nouf Al-Harbi::
PROBABILITY DISTRIBUTIONS DISCRETE RANDOM VARIABLES OUTCOMES & EVENTS Mrs. Aldous & Mr. Thauvette IB DP SL Mathematics.
PH24010 MathCAD Statistics, Random Numbers & Histograms.
AP STATISTICS LESSON AP STATISTICS LESSON PROBABILITY MODELS.
Win – W Loss – L 7W7W 11 W 2L2L 3L3L 12 L 7 not on 1 st roll - L 1 st sum Repea ted W
Descriptive Statistics Experiment Simulations Confidence Intervals Sampling Distribution Simulations Main Menu.
Chi Square Chi square is employed to test the difference between an actual sample and another hypothetical or previously established distribution such.
Statistics 11/7/ Statistics: Normal Curve CSCE 115.
11/7/ Statistics: Normal Curve CSCE /7/ Normal distribution The bell shaped curve The bell shaped curve Many physical quantities are.
Test of Goodness of Fit Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007.
The Chi-square Statistic
Definitions Addition Rule Multiplication Rule Tables
Box models Coin toss = Head = Tail 1 1
Probablity Density Functions
The Random Class and its Methods
AP Statistics: Chapter 7
PB2 Multistage Events and Applications of Probability
5.3 The Central Limit Theorem
Sampling Distribution
Sampling Distribution
Sampling Distributions
Review for test Ch. 6 ON TUESDAY:
WARM – UP 1. Phrase a survey or experimental question in such a way that you would obtain a Proportional Response. 2. Phrase a survey or experimental.
2.0 Probability Concepts definitions: randomness, parent population, random variable, probability, statistical independence, probability of multiple events,
Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007
Chapter 4 Section 1 Probability Theory.
Continuous Random Variable Normal Distribution
Simulation Discrete Variables.
CS150 Introduction to Computer Science 1
Sampling Distribution Models
Simulation allows us to perform “experiments” without actually having to do the experiments in real life...this is done through the use of random numbers.
Sampling Distributions
Chapter 6: Probability.
These probabilities are the probabilities that individual values in a sample will fall in a 50 gram range, and thus represent the integral of individual.
Trials & laws & Large Numbers (Large Number Theory)
Experiment #2 Resistor Statistics
Simulate Multiple Dice
Electrical and Computer Engineering Department SUNY – New Paltz
A random experiment gives rise to possible outcomes, but any particular outcome is uncertain – “random”. For example, tossing a coin… we know H or T will.
Presentation transcript:

Some (Pseudo-) Random Number Stuff in R

Use runif to make a “vector” of Random numbers with a uniform distribution Uniform means the number is as likely to fall between 0.1 and 0.2 as between 0.5 and 0.6, and so on. As opposed to a normal distribution around of mean of 0.5, then it is more likely to be close to the mean.

Result a vector with 100 “elements” or “components”

Apply some of the statistical methods to the vector.

Using the ifelse() method to turn the uniform numbers into a coin-toss simulation

Another way of simulating a coin toss in R using sample

The table method gets us the frequencies

The replace=TRUE part puts a value back into the set after it is picked. It allows duplications

The replace=FALSE part does not put a value back into the set after it is picked. It prevents duplications

If the range is 1 to 6 and replace=TRUE we have simulated 100 die rolls. Then the table method yields the frequencies

You can make a fast histogram of the die roll simulation by entering hist(dice)

Adding a breaks “argument” a sequence from 0. 5 to 6 Adding a breaks “argument” a sequence from 0.5 to 6.5 made the histogram a little nicer