Você está na página 1de 14

# Input Analysis

Chapter 4 (b)

By Lian Qi

Slide 1 of 14

## Specifying Model Parameters,

Distributions
Structural modeling: what weve done so far
Logical aspects entities, resources, paths, etc.

Quantitative modeling
Numerical, distributional specifications
Like structural modeling, need to observe systems
operation, take data if possible

Slide 2 of 14

## Deterministic vs. Random Inputs

Deterministic: nonrandom, fixed values
Number of units of a resource

## Random (a.k.a. stochastic): model as a

distribution, draw or generate values from to
drive simulation
Transfer, Interarrival, Processing times
What distribution? What distributional parameters?
Causes simulation output to be random, too

Slide 3 of 14

## Collecting and Using Data:

Alternatives and Issues
Use data directly in simulation
Read actual observed values to drive the model inputs
(interarrivals, service times, part types, )

## Or, fit probability distribution to data

Draw or generate synthetic observations from this
distribution to drive the model inputs
Weve done it this way so far

Slide 4 of 14

## Fitting Distributions to Data

with the Arena Input Analyzer
Assume:
Have sample data: Independent and Identically Distributed
(IID) list of observed values from the actual physical system
Want to select or fit a probability distribution for use in
generating inputs for the simulation model

## Arena Input Analyzer

Separate application, also accessible via Tools menu in
Arena

Slide 5 of 14

## Fitting Distributions to Data

with the Arena Input Analyzer (contd.)
Fitting = deciding on distribution form
(exponential, gamma, empirical, etc.) and
estimating its parameters
Several different methods (Maximum likelihood, moment
matching, least squares, )
Assess goodness of fit via hypothesis tests

## Best fit from among several distributions

Simulation with Arena, 3rd ed.

Slide 6 of 14

## Data Files for the Input Analyzer

Create the data file (editor, word processor,
Must be plain ASCII text (save as text or export)
Data values separated by white space (blanks, tabs,
linefeeds)

## Open data file from within Input Analyzer

File > New or
File > Data File > Use Existing or
Get histogram, basic summary of data
To see data file: Window > Input Data

## Can generate fake data file to play around

File > Data File > Generate New
Simulation with Arena, 3rd ed.

## Chapter 4(b) Input Analysis

Slide 7 of 14

Fits distributions, does goodness-of-fit tests
Fit a specific distribution form
Plots density over histogram for visual test
Gives exact expression to Copy and Paste (Ctrl+C, Ctrl+V)
over into simulation model
Gives results of goodness-of-fit tests

## Most important part: p-value, always between 0 and 1:

Small p (< 0.05 or so): poor fit (try again or give up)

## Chapter 4(b) Input Analysis

Slide 8 of 14

Fit all of Arenas (theoretical) distributions at
once
Fit > Fit All or
Returns the minimum square-error distribution

## Square error = sum of squared discrepancies between histogram

frequencies and fitted-distribution frequencies

## Could still be a poor fit, though (check p value)

To see all distributions, ranked: Window > Fit All Summary
or

Slide 9 of 14

## Some Issues in Fitting Input

Distributions
Not an exact science no right answer
Consider range of distribution
Infinite both ways (e.g., normal)
Positive (e.g., exponential, gamma)
Bounded (e.g., beta, uniform)

## Chapter 4(b) Input Analysis

Slide 10 of 14

No Data?
Happens more often than youd like
No good solution; some (bad) options:
Interview experts

## Min, Max: Uniform

Avg., % error or absolute error: Uniform
Min, Mode, Max: Triangular
Mode can be different from Mean allows asymmetry

## Number of random events in an interval: Poisson

Sum of independent pieces: normal
Product of independent pieces: lognormal
Simulation with Arena, 3rd ed.

Slide 11 of 14

## Cautions on Using Normal Distributions

Probably most familiar distribution
But it has infinite tails in both directions in
particular, has an infinite left tail so can always
(theoretically) generate negative values
Many simulation input quantities (e.g., time durations) must
be positive to make sense Arena truncates negatives to 0

## then P(negative) value is small one in a million

But in simulation, one in a million can happen
Moral avoid normal distribution as input model

Slide 12 of 14

## Nonstationary Arrival Processes

External events (often arrivals) whose rate varies
over time
Lunchtime at fast-food restaurants
Rush-hour traffic in cities
Telephone call centers
Seasonal demands for a manufactured product

## It can be critical to model this nonstationarity for

model validity
Ignoring peaks, valleys can mask important behavior
Can miss rush hours, etc.

## Good model: Nonstationary Poisson process

Simulation with Arena, 3rd ed.

Slide 13 of 14

## Nonstationary Arrival Processes (contd.)

Two issues:
How to specify/estimate the rate function
How to generate from it properly during the simulation

## Several ways to estimate rate function well

just do the piecewise-constant method
Divide time frame of simulation into subintervals of time
over which you think rate is fairly flat
Compute observed rate within each subinterval
In Arena, must convert to expected number of arrivals per
hour on subintervals of time that need not be of one-hour
length

Slide 14 of 14