3 views

Uploaded by Abdu Abdoulaye

Basics Simulation

- ADC - Lec 2 - Probability
- DOANE - STAT - Chap 006
- Statistical Evaluations in Exploration for Mineral Deposits - Prof. Dr. Friedrich-Wilhelm Wellmer.pdf
- MATH 533 Project 1 .doc
- Statistics
- IT industry
- it223syllabus
- ANG2ed-3-r
- Autograph Brochure 8p
- S2 May 2013 (International)
- Probability Blog 1
- Class-3-PD
- US Federal Reserve: 199847pap
- sas work
- S1 Practice Paper
- 2014_ps01_sol
- Big Bang in Mathematics - Abstract Form and John Bredakis Method in Brief.
- Tutorial 1 Student
- Nuismer Et Al 2013 Evolution Coevolution Mutualistic Network
- Mathematics Methods Formula Sheet 2017

You are on page 1of 11

Spreadsheet Simulation

Basics

IENG 455

Feng Yang

West Virginia University

1

Outline

Probability Review for Input Modeling

distributions

standard tricks

How SIMTOOLS works

what happens on an iteration

producing random inputs

Common Modeling Techniques

In-Class Practice

1

Probability Distribution

TRIANG Height is proportional

to probability of

outcome near that

value

x

12 15 21

DISCRETE

Height is equal to

the probability of

the outcome

x

1 2 3 4

probability distribution, the first question is:

What is the collection of possible outcomes?

3

Possible Outcomes

Discrete, and a finite number of them.

# of workers absent out of 70 on a shift

number of defective parts in a lot of 100

number of available presses on Monday

Discrete, and an infinite number of them.

Annual demand for a product

Number of accidents during the year

Number of parts produced until the machine

jams

2

Possible Outcomes (contd)

Continuous, over a finite range.

The actual diameter of a machined part

Number of productive hours during a day

Interest rate change next year on an adjustable rate

mortgage

Continuous, with fixed lower bound.

Total time to complete a work order

Time to failure of a machine or component

Continuous, with infinite upper and lower bounds.

hours a shipment is early or late

deviation of a machined diameter from specs

deviation of demand from forecast

Distributions Classifications

Discrete and a finite number Binomial, Discrete,

Hypergeometric, IntUniform

Continuous over a fixed range Beta, Triang, Uniform

bound Lognorm, Pearson5, Pearson6,

Weibull

3

Standard Tricks

X is a random variable

E( X + a ) = E( X ) + a

Var( a X ) = a2 Var( X )

Make a distribution with lower bound 0 into a distribution with

lower bound a.

TRIANINV( RAND( ), 0, 1, 2 ) + a

pdf: pdf:

x x

0 1 2 0 a a+1 a+ 2

shift the mean by a. Thus, in this example the new mean is

a +1

7

Make a distribution with possible outcomes in the range (0,1)

into a distribution whose outcomes have range (a, b) by

multiplying by ( b - a ) and adding a.

Ex: a + ( b - a )*RAND( )

pdf:

x

0 0.03 0.05

transformation.

new mean = a + ( b - a ) * (old mean)

new variance = ( b - a )2 *(old variance)

8

4

Creating Uncertainty

How are the random input values generated?

All simulation languages have a way to produce a sequence of

pseudorandom numbers.

Uniform(0,1) 1 0 x 1

f ( x) =

0 otherwise

Important statistical properties of a sequence of uniformly

distributed random numbers, U1, U2, U3,

1. Uniformity

2. Independence: the probability of observing a value in a

particular interval is independent of the previous values drawn.

9

Generation of

Pseudo-Random Numbers

Goal: produce a sequence of numbers in [0,1] which

simulates, or imitates, the ideal properties of uniform

distribution and independence as closely as possible.

Linear congruential method produces a sequence of

integers, X1, X2, X3, between 0 and m-1:

X i+1 = (aXi + c) mod m, i = 0, 1, 2, ...

Ui = X i / m, i = 1, 2, ...

X0: seed; a: constant multiplier; c: increment; m: modulus

returns the remainder after n1 is divided by n2

10

5

Example

X0 = 27, a = 17, c = 43, m = 100

11

X0

27

a

17

c

43

m

100

Pseudo-Random Numbers

(contd)

X0 27

X1 2 U1 0.02 Sequence: 0.02, 0.77, 0.52,

X2 77 U2 0.77

X3 52 U3 0.52 Can only take values from {0,

X4 27 U4 0.27 1/m, 2/m, , (m-1)/m}

X5 2 U5 0.02

X6 77 U6 0.77 Make m a large integer such as

X7 52 U7 0.52

m=248

X8 27 U8 0.27

X9 2 U9 0.02

The pseudorandom numbers as a

X10 77 U10 0.77

X11 52 U11 0.52

long (at least 2 billion) list of

X12 27 U12 0.27 numbers in the interval [0, 1]

X13 2 U13 0.02 that appear to be independent

X14 77 U14 0.77 random values, but are

X15 52 U15 0.52

completely repeatable.

X16 27 U16 0.27

12

6

Random-Variate Generation

Random numbers on the interval [0,1] can be converted into

random values from any distribution.

Inverse Transform Technique can be used to sample from the

exponential, the uniform, the Weibull, and the triangle

distributions and empirical distributions.

E.g., Generating random numbers X1, X2, X3, which have an

exponential distribution.

x

1. Compute the cdf of X: F( x) = 1-e ( x 0)

2. Set F( X ) = U U ~ Uniform(0,1)

Solve F( X ) = U for X in terms of U

1

X = ln(1 U )

3. Generate Uniform RVs U1, U2, U3, and compute

X i = F-1 (U i )

13

Exponential Distribution

500500Uniform(0,1)

Uniform(0,1)

0

1.200

Mean=0.5000224

1.000

0.600

generates Exponential

0.400

0.200

RVs with mean 1 is

0.000

0 0.25 0.5 0.75 1

X = -ln(1-U)

100%

0 1

500500

Exponential(1)

Exponential(1)

0.900

0.800

Mean=1.000154

The plots show 500

0.700

0.600 U(0,1)s and the

0.500

0.400

0.300

corresponding

0.200

0.100

Exponentials

0.000

0 2 4 6 8

90% 5%

.0499 2.976

14

7

Example

Triangular Distribution

Consider a RV X with pdf pdf:

x, 0 x 1 x

f ( x) = 2 x 1 x 2 0 1 2

0

otherwise

0, x0

2

Step 1: Compute cdf x /2 0 < x 1

F( x) =

1 - (2 - x) /2 1 < x 2

2

1 x>2

Step 2: For 0 X 1, U= X 2 / 2 (0 U 1/2)

For 1 X 2, U = 1 - ( 2 X ) 2 / 2 (1/2 U 1)

0 U 1/ 2

X = F-1 (U ) X = 2U

2 2(1 U ) 1/2 U 1

15

The value of a cell is uncertain, but depends on no other cell.

Ex: The demand for product ABC-123 next month is

modeled as Poisson with mean 1500

In the cell for demand put

= POISINV(RAND( ), 1500)

The uncertain outcome in one period depends on uncertain

outcomes in previous periods.

Ex: For the next 4 quarters, sales in one period are expected

to be the same as the previous period, but with an average

deviation of 20%.

A1: current sales

A2: = NORMINV( RAND( ), A1, 0.2*A1)

A3: = NORMINV( RAND( ), A2, 0.2*A2)

A4: = NORMINV( RAND( ), A3, 0.2*A3)

16

8

Do not confuse functional and statistical dependence:

If a functional relationship is known, use it.

Ex: If number of returns (C1) is a fraction (B1) of number of sales

(A1), first express that logical relationship (C1: = A1*B1), then select

distributions for A1 and B1.

A statistical relationship is a tendency, with the strength

ranging from -1 to +1.

Ex: Sales in market sector A tend to go up with sales in market sector

B. This will be modeled by a correlation.

The value in the cell depends on a specific event that either does

or does not happen.

Ex: If release 2.0 is ready by January (65% chance), then we will

ship 120,000 units; otherwise we will have to release it in June and

we will only ship 40,000 copies.

A1: = BINOMINV( RAND( ), 1 , 0.65 )

B1: = (1-A1)*40000 + A1*120000

or an alternative

B1: = IF(A1=1, 120000, 40000) 17

Drug Development

A drug company is planning to invest in a new drug. The

cost of research has a uniform distribution on $300,000 to

$500,000. There is a 40% chance that the drug will not be

effective, in which case there will be no sales. If the drug is

effective, then the total market for the drug is 400,000

people. The company expects their share of the market to

have a triangular distribution with minimum 5%,

maximum 30%, and most likely 20% of the people. For

each person who uses the new drug, the company expects

to make $100 in sales during the first year. The drug

company would like to know the distribution of profit

they can expect from undertaking this investment.

18

9

Drug Development (contd)

Cost of Drug Development Revenue

Effectiveness ?

Market Share ?

Revenue per person ?

Number of People ?

Total Profit ?

Find out the distribution of Total Profit.

19

Effectiveness 0

Market Share 0.129254114

Revenue per person $100.00

Number of People $400,000.00

0 4,933,579.21

0.001001 -455,347.63

0.002002 -333,638.31

0.003003 -352,831.21

0.004004 6,936,666.44

0.00500501 3,984,978.68

20

10

Histogram of Total Profit (1000 obs.)

Total Profit Num of obs.

<0 390

>2,000,000 608

>6,000,000 412

>8,000,000 202

>10,000,000 42

21

11

- ADC - Lec 2 - ProbabilityUploaded byAhmad Mahmood
- DOANE - STAT - Chap 006Uploaded byBG Monty 1
- Statistical Evaluations in Exploration for Mineral Deposits - Prof. Dr. Friedrich-Wilhelm Wellmer.pdfUploaded byShofi Hawan
- MATH 533 Project 1 .docUploaded byVictor Vincent Renner
- StatisticsUploaded bySeleneGoberdhan
- IT industryUploaded byVignesh Periyasamy
- it223syllabusUploaded bycrutili
- ANG2ed-3-rUploaded bybenieo96
- Autograph Brochure 8pUploaded byJohnson Liu
- S2 May 2013 (International)Uploaded bykwy_candy
- Probability Blog 1Uploaded byAkash Ashish Gautama
- Class-3-PDUploaded byRicha Anand
- US Federal Reserve: 199847papUploaded byThe Fed
- sas workUploaded byAmruta Madankar
- S1 Practice PaperUploaded byAhmed Nurul
- 2014_ps01_solUploaded byPatrick Sibanda
- Big Bang in Mathematics - Abstract Form and John Bredakis Method in Brief.Uploaded byΓιάννης Μπρεδάκης
- Tutorial 1 StudentUploaded bySarviin Ageelen
- Nuismer Et Al 2013 Evolution Coevolution Mutualistic NetworkUploaded byLucía Soler
- Mathematics Methods Formula Sheet 2017Uploaded byZeba Zia
- Chapitre 4 SimulationUploaded bycyrine khbou
- Topic13_PoissonProcessUploaded byJane Hanger
- 4Uploaded byVinesh Jugmohun
- p1270.pdfUploaded byIvaldo1976
- unit IIIUploaded byPiyush Chaturvedi
- 1.5 s Shift in the Six Sigma ProcessUploaded bysellans ns
- Types of DataUploaded byahmedali
- ictlesson4-130808173423-phpapp011Uploaded byapi-236129938
- GridDataReport-data kedalam pt LAK.rtfUploaded byCindy Gracia

- The Service Concept the Missing Link in Service Design ResearchUploaded bydarkennimbus
- Homework 1Uploaded byAbdu Abdoulaye
- Ch4-STUDENTv Intro to ProbabilityUploaded byAbdu Abdoulaye
- Ch3- BOTH 2nd Part-Descriptive Statistics- Distribution ShapeUploaded byAbdu Abdoulaye
- Ch2- Descriptive Statistics- Tabular and Graphical PresentationsUploaded byAbdu Abdoulaye
- 1.0 Data Representation SlidesUploaded byAbdu Abdoulaye
- Lab 2 Part 2-Ataya ExcelUploaded byAbdu Abdoulaye
- Exam 1 Chpt3 Stugy GuideUploaded byAbdu Abdoulaye
- Lecture 04 SlidesUploaded byAbdu Abdoulaye
- Lecture 03 Slides (1)Uploaded byAbdu Abdoulaye
- Lecture 02 Slides (2)Uploaded byAbdu Abdoulaye
- Yip Phaal ProbertUploaded byAbdu Abdoulaye
- Beaumont Metric SidUploaded byAbdu Abdoulaye
- Solution HW 5.Q1Uploaded byAbdu Abdoulaye
- SPLM Licensing InstallUploaded byAbdu Abdoulaye
- SPLMLicensing User GuideUploaded byAbdu Abdoulaye
- IMSE Research Plan Spring 2017Uploaded byAbdu Abdoulaye
- Performance Evaluation of Disposable Sampler for Inhalable.docxUploaded byAbdu Abdoulaye
- Lab 3 ReportUploaded byAbdu Abdoulaye
- Homework 2Uploaded byAbdu Abdoulaye
- High Throughput Sortation Devices Quiz (1)Uploaded byAbdu Abdoulaye
- High Throughput Sortation Devices (1)Uploaded byAbdu Abdoulaye
- Hammock Product StructureUploaded byAbdu Abdoulaye
- Extravagant Alfresco Fittings Project 1Uploaded byAbdu Abdoulaye
- EE222_Syllabus_F16Uploaded byAbdu Abdoulaye
- DJUploaded byAbdu Abdoulaye
- EE LAB REPORT 1Uploaded byAbdu Abdoulaye
- Curry Andalla HW3Uploaded byAbdu Abdoulaye

- A Logistic Regression Model of Customer Satisfaction of AirlineUploaded byjosephatpeter
- 1D2DCE53d01Uploaded bygerte_yuew
- Testimony: “Credit Reports: Consumers’ Ability to Dispute and Change Inaccurate Information” CDIA (2007)Uploaded byJillian Sheridan
- Dividend AnalysisUploaded byshobasridhar
- Suicides CDC ReportUploaded byZacharyEJWilliams
- skittles project 1Uploaded byapi-299868669
- Sample Preparation Composite and Replicate Strategy for Assay of Solid Oral Drug ProductUploaded bysamantha
- Creative Writing ProcessUploaded bySimona Symonyci
- MC0074-Unit-02Uploaded byDeepti Waddin
- Characteristis Types ProcessUploaded byJitha Kannan
- Determination of the Organoleptic Quality of Hard Dough BiscuitsUploaded byIJAERS JOURNAL
- Quary 2-ms4.xlsxUploaded byMehran
- ggeUploaded byIsmael Neu
- Logistic Regression Using RUploaded bysoma1243
- sss3Uploaded byJoanne Wong
- Statistics - TravelUploaded byMuzamil Kazmi
- Statistical Tests in SPSSUploaded byNikola Red
- list 20150331.pdfUploaded byHuesni
- MB0040 Statistics for ManagementUploaded byAnish Nair
- NFPA--FIRE LOSS IN THE UNITED STATES DURING 2009Uploaded bywmartin46
- MR Course DetailUploaded byapi-3841013
- Quality Engg.Uploaded byNilankan Kumar
- Measurement of Variables UsedUploaded byRahul Agrawal
- Tutorial 01 SolUploaded bySeNka Nermin Muj
- Sampling MethodsUploaded byCox Abee
- Revisi - Application of Kalman Filter for Estimated Elevation WaterUploaded byciesca22
- Week 1 Solutions Ch2(1)Uploaded byRamon Sánchez
- Michael S. Lewis-Beck-Data Analysis_ an Introduction, Issue 103-SAGE (1995)Uploaded byArletPR
- Statistics midterm keyterms and formulasUploaded byCuma Kaya
- Chi Square TestUploaded byatheeban