Random Numbers and Simulation

Slides:



Advertisements
Similar presentations
Monte Carlo Methods and Statistical Physics
Advertisements

Sampling Distributions (§ )
Descriptive statistics Experiment  Data  Sample Statistics Sample mean Sample variance Normalize sample variance by N-1 Standard deviation goes as square-root.
Bayesian estimation Bayes’s theorem: prior, likelihood, posterior
Chapter 6 Introduction to Sampling Distributions
Fall 2006 – Fundamentals of Business Statistics 1 Chapter 6 Introduction to Sampling Distributions.
Statistics Lecture 20. Last Day…completed 5.1 Today Parts of Section 5.3 and 5.4.
Descriptive statistics Experiment  Data  Sample Statistics Experiment  Data  Sample Statistics Sample mean Sample mean Sample variance Sample variance.
Evaluating Hypotheses
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
The Monte Carlo Method: an Introduction Detlev Reiter Research Centre Jülich (FZJ) D Jülich
Normal and Sampling Distributions A normal distribution is uniquely determined by its mean, , and variance,  2 The random variable Z = (X-  /  is.
Standard error of estimate & Confidence interval.
Chapter 6: Sampling Distributions
Simulation of Random Walk How do we investigate this numerically? Choose the step length to be a=1 Use a computer to generate random numbers r i uniformly.
Short Resume of Statistical Terms Fall 2013 By Yaohang Li, Ph.D.
Monte Carlo Simulation and Personal Finance Jacob Foley.
General Principle of Monte Carlo Fall 2013 By Yaohang Li, Ph.D.
Sampling Distribution ● Tells what values a sample statistic (such as sample proportion) takes and how often it takes those values in repeated sampling.
1 Lesson 3: Choosing from distributions Theory: LLN and Central Limit Theorem Theory: LLN and Central Limit Theorem Choosing from distributions Choosing.
Estimating parameters in a statistical model Likelihood and Maximum likelihood estimation Bayesian point estimates Maximum a posteriori point.
Today’s lesson Probability calculations with the standard normal distribution. Making predictions based on the specification of a normal distribution.
AP Statistics 9.3 Sample Means.
Random Numbers and Simulation  Generating truly random numbers is not possible Programs have been developed to generate pseudo-random numbers Programs.
MA-250 Probability and Statistics Nazar Khan PUCIT Lecture 26.
Population and Sample The entire group of individuals that we want information about is called population. A sample is a part of the population that we.
: An alternative representation of level of significance. - normal distribution applies. - α level of significance (e.g. 5% in two tails) determines the.
Markov Chain Monte Carlo for LDA C. Andrieu, N. D. Freitas, and A. Doucet, An Introduction to MCMC for Machine Learning, R. M. Neal, Probabilistic.
Point Estimation of Parameters and Sampling Distributions Outlines:  Sampling Distributions and the central limit theorem  Point estimation  Methods.
1 Sampling distributions The probability distribution of a statistic is called a sampling distribution. : the sampling distribution of the mean.
Week 111 Review - Sum of Normal Random Variables The weighted sum of two independent normally distributed random variables has a normal distribution. Example.
Central Limit Theorem Let X 1, X 2, …, X n be n independent, identically distributed random variables with mean  and standard deviation . For large n:
Week 21 Order Statistics The order statistics of a set of random variables X 1, X 2,…, X n are the same random variables arranged in increasing order.
Week 21 Statistical Model A statistical model for some data is a set of distributions, one of which corresponds to the true unknown distribution that produced.
Chapter 5 Confidence Interval
Introduction For inference on the difference between the means of two populations, we need samples from both populations. The basic assumptions.
Standard Errors Beside reporting a value of a point estimate we should consider some indication of its precision. For this we usually quote standard error.
EMIS 7300 SYSTEMS ANALYSIS METHODS FALL 2005
MCMC Output & Metropolis-Hastings Algorithm Part I
STATISTICAL INFERENCE
Monte Carlo simulation
STAT 311 Chapter 1 - Overview and Descriptive Statistics
3. The X and Y samples are independent of one another.
STAT 311 REVIEW (Quick & Dirty)
7-1 Introduction The field of statistical inference consists of those methods used to make decisions or to draw conclusions about a population. These.
Chapter 8: Fundamental Sampling Distributions and Data Descriptions:
Sample Mean Distributions
Sampling Distributions
Chapter 7: Sampling Distributions
Parameter, Statistic and Random Samples
Statistical Process Control
CAP 5636 – Advanced Artificial Intelligence
Random Sampling Population Random sample: Statistics Point estimate
Sampling Distribution of the Sample Mean
Lecture 2 – Monte Carlo method in finance
CS 188: Artificial Intelligence
EM for Inference in MV Data
CHAPTER 15 SUMMARY Chapter Specifics
Lecture 1 Cameron Kaplan
Lecture 7 Sampling and Sampling Distributions
Essential Statistics Sampling Distributions
EM for Inference in MV Data
Sampling Distributions (§ )
Chapter 8: Fundamental Sampling Distributions and Data Descriptions:
Statistical Model A statistical model for some data is a set of distributions, one of which corresponds to the true unknown distribution that produced.
Statistical Model A statistical model for some data is a set of distributions, one of which corresponds to the true unknown distribution that produced.
Applied Statistics and Probability for Engineers
Fundamental Sampling Distributions and Data Descriptions
Presentation transcript:

Random Numbers and Simulation Generating truly random numbers is not possible Programs have been developed to generate pseudo-random numbers Values are generated from deterministic algorithms © Fall 2011 John Grego and the University of South Carolina

Random Numbers Pseudo-random deviates can pass any statistical test for randomness They appear to be independent and identically distributed Random number generators for common distributions are available in R Special techniques (STAT 740) may be needed as well

Monte Carlo Simulation Some common uses of simulation Modeling stochastic behavior Calculating definite integrals Approximating the sampling distribution of a statistic (e.g., maximum of a random sample) Use when analytical results are difficult, unavailable or unconfirmed. Students are used to analytical results.

Modeling Stochastic Behavior Buffon’s needle Random Walk Observe X1, X2, …, where p=P(Xi=1)=P(Xi=-1)=.5 and study S1,S2,…, where This is also called Gambler’s ruin; each Xi represents a $1 bet with a return of $2 for a win and $0 for a loss. Buffon’s Needle: why bother? The analytical result isn’t that difficult.

A Fair Game The properties of a fair game (p=.5) are a lot more interesting than the properties of an unfair game (p≠.5) Some properties of this process are easy to anticipate (E(S)) Run code. Source Random_Walk.R

Gambler’s Ruin Some properties are difficult to anticipate, and can be aided by simulation. Expected number of returns to 0 Expected length of a winning streak Probability of going broke given an initial bank

Calculating Definite Integrals In statistics, we often have to calculate difficult definite integrals (posterior distributions, expected values) (here, x could be multidimensional)

Integral Examples Example 1 Example 2

Hit-or-Miss Monte Carlo Example Determine c such that c≥h(x) across entire region of interest (here, c=4)

Hit-or-Miss Monte Carlo Simulation Generate n random uniform (Xi,Yi) pairs, Xi’s from U[a,b] (here, U[0,1]) and Yi’s from U[0,c] (here, U[0,4]) Count the number of times (call this m) that Yi is less than h(Xi) Then I1 ≈c(b-a)m/n I.e., (height)(width)(proportion under curve)

Classical Monte Carlo Integration Take n random uniform values, U1,…,Un over [a,b] and estimate I using This method seems straightforward, but is actually more efficient than Hit-or-Miss Monte Carlo b-a is the width. The sum of h’s over n is the sample average of height from a uniform random sample on the x axis.

Expected Values Suppose X is a random variable with density f. Find E[h(x)] for some function h, e.g.,

Esimtating Expected Values For n random values X1, X2, …, Xn from the distribution of X (i.e., with density f), For the first term, integrate over the density of X (the population average).

Examples Example 3: If X is a random variable with a N(10,1) distribution, find E(X2) Example 4: If Y is a random variable with a Beta(5,1) distribution, E(-lnY) There are more advanced methods of integration using simulation (Importance Sampling) E(X^2) is 101

Integration integrate() performs numerical integration for functions of a single variable (not using simulation techniques) adapt() in the adapt package performs multivariate numerical integration

The Sampling Distribution of a Statistic To perform inference (CI’s, hypothesis tests) based on sampling statistics, we need to know the sampling distribution of the statistics, at least up to an approximation Example: X1, X2, …, Xn ~ iid N(m,s2).

Approximating the Sampling Distribution of a Statistic What if the data’s distribution is not known? Large sample: Central Limit Theorem Small sample: Normal theory or nonparametric procedures based on permutation distributions

Simulating the Sampling Distribution of a Statistic If the population distribution is known, we can approximate the sampling distribution with simulation. Repeatedly (m times) generate random samples of size n from the population distribution Calculate a statistic (say, S) each time The empirical (observed) distribution of S-values approximates the true distribution of S

Example X1, X2, X3, X4 ~Expon(1) What is the sampling distribution of: