CS433Modeling and Simulation
Lecture 16
Output AnalysisLarge-Sample Estimation
Theory
Dr. Anis Koubâa30 May 2009
Al-Imam Mohammad Ibn Saud UniversityAl-Imam Mohammad Ibn Saud University
Goals of Today
Understand the problem of confidence in simulation results
Learn how to determine of range of value with a certain confidence a certain stochastic simulation result
Understand the concept of Margin of Error Confidence Interval with a certain level
of confidence
Reading
Required Lemmis Park, Discrete Event Simulation - A
First Course, Chapter 8: Output Analysis
Optional Harry Perros, Computer Simulation Technique
- The Definitive Introduction, 2007Chapter 5
Problem Statement
For a deterministic simulation model one run will be sufficient to determine the output.
A stochastic simulation model will not give the same result when run repetitively with independent random seed. One run is not sufficient to obtain confident
simulation results from one sample. Statistical Analysis of Simulation Result:
multiple runs to estimate the metric of interest with a certain confidence
Example:
Stoachatsic Simulation results may vary from one run/replication to another
Simulation results depends on three factors: The seed of the RNG Number of samples/size of samples Simulation time
Objective For a given large sample output, determine what
is the mean value with a certain confidence on the result.
What types of parameters to estimate?
In general, a stochastic variable is described by their probability distributions and parameters. For quantitative random variables: mean and variance
For a binomial random variables: success probability p.
If the values of parameters are unknown, we make inferences about them using sample information.
How to express the confidence?
Simulation results must be expressed with a certain confidence.
The confidence needs the following parameters Confidence Level: 99%, 98%, 95% or 90% Variance: the variance of the simulation results Sample Size: the number of simulation results
under study There are two ways:
Margin of Error: The maximum error of estimation. Confidence interval: The interval where most of the
simulation results lie.
The Margin of Error
estimator theoferror std96.1 estimator theoferror std96.1
Margin of error: The maximum error of estimation, calculated as
Estimating Means and Proportions
For a quantitative population,
n
sn
xμ
96.1 :)30(error ofMargin
:mean population ofestimator Point
n
sn
xμ
96.1 :)30(error ofMargin
:mean population ofestimator Point
For a binomial population,
n
qpn
x/npp
ˆˆ96.1 :)30(error ofMargin
ˆ : proportion population ofestimator Point
n
qpn
x/npp
ˆˆ96.1 :)30(error ofMargin
ˆ : proportion population ofestimator Point
Example 1
Point estimator of : 252,000
15,000Margin of error : 1.96 1.96 3,675
64
μ x
s
n
Point estimator of : 252,000
15,000Margin of error : 1.96 1.96 3,675
64
μ x
s
n
A homeowner randomly samples 64 homes similar to
his own and finds that the average selling price is
252,000 SAR with a standard deviation of 15,000 SAR.
Question: Estimate the average selling price for all
similar homes in the city.
A quality control technician wants to estimate the
proportion of soda bottles that are under-filled. He
randomly samples 200 bottles of soda and finds 10
under-filled cans.
What is the estimation of the proportion of under-
filled cans?200 proportion of underfilled cans
ˆPoint estimator of : 10 / 200 .05
ˆ ˆ (.05)(.95)Margin of error: 1.96 1.96 .03
200
n p
p p x/n
pq
n
200 proportion of underfilled cans
ˆPoint estimator of : 10 / 200 .05
ˆ ˆ (.05)(.95)Margin of error: 1.96 1.96 .03
200
n p
p p x/n
pq
n
Example 2
Interval Estimators
Confidence Interval
Confidence Interval
• “Fairly sure” means “with high probability”, measured using the confidence coefficient, 1-confidence coefficient, 1-..
• Suppose 1- = 0.95 and that the estimator has a normal distribution.
Parameter 1.96SEParameter 1.96SE
Usually, 1- = 0.90, 0.95, 0.98, 0.99
To Change the Confidence Level
• To change to a general confidence level, 1-, pick a value of z that puts area 1- in the center of the z-distribution (i.e. Normal Distribution N(0,1).
100(1-)% Confidence Interval: Estimator zSE100(1-)% Confidence Interval: Estimator zSE
Tail area
/2
Confidence Level z/2
0.05 0.1 90% 1.645
0.025 0.05 95% 1.96
0.01 0.02 98% 2.33
0.005 0.01 99% 2.58/2 s
x zn
Confidence Intervals for Means and Proportions
For a quantitative population
n
szx
μ
2/
:mean population afor interval Confidence
n
szx
μ
2/
:mean population afor interval Confidence
For a binomial population
n
qpzp
p
ˆˆˆ
: proportion population afor interval Confidence
2/n
qpzp
p
ˆˆˆ
: proportion population afor interval Confidence
2/
Example 1A random sample of n = 50 males
showed a mean average daily intake of dairy products equal to 756 grams with a standard deviation of 35 grams. Find a 95% confidence interval for the population average m.
n
sx 96.1
50
3596.17 56 70.97 56
grams. 65.70 746.30or 7
Example 1 Find a 99% confidence interval for m,
the population average daily intake of dairy products for men.
n
sx 58.2
50
3558.27 56 77.127 56
grams. 7 743.23or 77.68 The interval must be wider to provide for the increased confidence that is does indeed enclose the true value of .
Example 2
Of a random sample of n = 150 college students, 104 of the students said that they had played on a soccer team during their K-12 years. Estimate the proportion of college students who played soccer in their youth with a 98% confidence interval.
n
qpp
ˆˆ33.2ˆ
150
)31(.69.33.2
104
150
09.. 69 .60or .78. p
How to Choose the Sample Size?
Choosing the Sample Size
The total amount of relevant information in a sample is controlled by two factors:- The sampling plansampling plan or experimental experimental designdesign: the procedure for collecting the information- The sample size sample size nn: the amount of information you collect.
In a statistical estimation problem, the accuracy of the estimation is measured by the margin of errormargin of error or the width of the width of the confidence intervalconfidence interval..
1. Determine the size of the margin of error, B, that you are willing to tolerate.
2. Choose the sample size by solving for n or n n 1 n2 in the inequality: 1.96 SE B, where SE is a function of the sample size n.
3. For quantitative populations, estimate the population standard deviation using a previously calculated value of ss or the range approximation Range / 4.Range / 4.
4. For binomial populations, use the conservative approach and approximate p using the value pp .5 .5.
Choosing the Sample Size
Example
A producer of PVC pipe wants to survey wholesalers who buy his product in order to estimate the proportion of wholesalers who plan to increase their purchases next year. What sample size is required if he wants his estimate to be within .04 of the actual proportion with probability equal to .95?
04.96.1 n
pq04.
)5(.5.96.1
n
5.2404.
)5(.5.96.1 n 25.6005.24 2 n
He should survey at least 601 wholesalers.
Key Concepts
I. Types of EstimatorsI. Types of Estimators1. Point estimator: a single number is calculated to estimate the population parameter.2. Interval estimatorInterval estimator: two numbers are calculated to form an interval that contains the parameter.
II. Properties of Good EstimatorsII. Properties of Good Estimators1. Unbiased: the average value of the estimator equals the parameter to be estimated.2. Minimum variance: of all the unbiased estimators, the best estimator has a sampling distribution with the smallest standard error.3. The margin of error measures the maximum distance between the estimator and the true value of the parameter.
III. Large-Sample Point EstimatorsIII. Large-Sample Point Estimators
To estimate one of four population parameters when the sample sizes are large, use the following point estimators with the appropriate margins of error.
Key Concepts
Key Concepts
IV. Large-Sample Interval EstimatorsIV. Large-Sample Interval Estimators
To estimate one of four population parameters when the sample sizes are large, use the following interval estimators.
Key Concepts
1. All values in the interval are possible values for the unknown population parameter.
2. Any values outside the interval are unlikely to be the value of the unknown parameter.
3. To compare two population means or proportions, look for the value 0 in the confidence interval. If 0 is in the interval, it is possible that the two population means or proportions are equal, and you should not declare a difference. If 0 is not in the interval, it is unlikely that the two means or proportions are equal, and you can confidently declare a difference.
V. One-Sided Confidence BoundsV. One-Sided Confidence BoundsUse either the upper () or lower () two-sided bound, with the critical value of z changed from z / 2 to z.