Simulation Flashcards
what is simulation
technique used in analyzing models where the value to be assumed by 1/more independant vbls is uncertain
is simulation deterministic or probabilistic
probabilistic! because the value of one or more independant variables is uncertain!!
why would u use simulation
computer model that imitates reality- iti ncorporates uncertainty into its variables
pro of simulations
allows managers to ask what-if questions without changing anything irl- just on the computer
its better to test in the simulation than irl
2 categories of simulaiton
1) monte carlo simulation
2) discrete event simulation
monte carlo simulation
repeated samplings from probability distributions of model inputs to characterize the distribution of model outputs!!
THIS IS WHAT WELL LEARN
discrete event simulation
models the dynamics and behaviour of INTERACTING elements of a system!
-> ex: physical simulations in a factory or with service flow
how can you model inventory problems
the random number generator!! this is why we need the @risk package
what is the newspaper problem?
why do we use this example?
the vendor must buy the number of papers for that day before knowing the amount of demand per day
because it is a good example of a one-time decision problem
what problems have a one time decision?
this is when you have only one chance to make a decision to order a product (ex: baked goods, seasonal products) that can be sold at a discount if u buy too much
what are costs of having too much inventory
1) material costs (purchase price)
2) handling and storage (if multiple period problem)
3) handling cost ($ tied up)
4) spoilage with potential salvage (we can maybe sell day old bakery products at 50% off)
what happens if we dont have enough inventory
OPPORTUNTIY COST= lost the chance to make profits
-> this is the implicit costs (not measured on out of pocket costs but still exist)
what are the types of costs associated with too little inventory
1) lost sales adn profit
2) lost goodwill
3) cost if a rush order to replenish (purchase & transport)
what is the green cell
distribution cell, this is the cell where input is uncertain and we USE RISK!!!
what is the yellow cell
parameter/changing cell
this is the controllable input that we vary
what is the blue cell
the output cell, the value we want @ risk to monitor
why would we use @risk
because we want to replicate uncertainty of demandw
what is the logical IF statement for storage cost
=IF(amount stocked > demand, (amount stocked-dmeand)*(storage cost),0)
if we have excess, then storage cost
if we dont hahve access, then no storage cost
what is the logical IF statement for stockout cost
=IF(amt stocked < demand, (demand-amount stocked)*(stockour cost),0)
what is the blue cell value
sum of COSTS
what is the higher cost usually= stockout or storage
stockout!!!!
it is very typical to run out of a product than to have too much
what are the 3 distributions we use in @risk
continuous: normal
discrete: posisson & binomial
what is the poisson distribution
discrete probability distribution
probability of a given number of events occurring in a fixed interval of time
if these events occur with a known constant mean rate and INDEPENDANTYL
how to run RISK
STEPS
0) SET UP THE NUMBERS!! in the white cell have your if statemetns or whatever, the blue is like the sum!!!
1) select the green cell (will be showing the uncertain values)
2) click distribution
3) click poisson
4) set lambda= desired value
5) lookk at the graph and analyze it
6) once you do this you will have a formula in the text address cell! this is good you did it good
7) toggle on the dice, this will give you a new random number, and press F9
8)click on the cell you want to run risk on (BLUE), then click on ‘OUTPUT’, and then OK
9)click iterations in the top right and run 1000 times
10) click settings and go into sampling tab, and then change the seed value
11) verify the model (CLICK ON MODEL , CHECK INPUTS AND OUTPUTS)
12) simulate!! run the simulaiton
poisson
-what is lambda
-what is k
-mean number of events occuring
-number of time something happens in a given time frame
how to understand the poisson graph in @risk
-x axis values= the k value (how many times the event will occur)
-y axis value= the chance that event will occur k times
CAREFULL!!! MAKE SURE THAT THE DICE / RANDOM RECALC ALWAYS ON BEFORE YOU DO THE SIMULATION!!! so you dont run the same demand 1000 times
We typically run 1,000 trials for a simulation as it is large enough to give good results (sample size) but does not take too long to run.
how to verify your model
1) click the model button on the @risk tab to view all the defined cells in the model
2) chehck inputs
3) check outputs
what is the point of the seed value
a seed value is a number that is linked to a series of random numbers
if you use the same seed value, the random numbers will be the same each time
will different seed values give entirely different sets of random numbers
NO! because underlying distribution is still the same so numbers will be relatively similar
how to state the answer!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
THE AVERAGE EXPECTED COST IS 12.26
what is the point estimate
-where DO WE GET THIS
-IS THIS WHAT WE CARE ABOUT??
-how do we convert xbar to mu?
the sample mean, THE Xbar
this is what the simulaiton will give us!!! but we dont care about this sample mean, we want the POPULATION MU!!!!!!
-use confidence intervals
how to get the mu from the xbar mean
use confidence intervals around the point estimate
WHAT does the clt say
that if the same size is large enough, the distribution will be normal
how is clt important for us
the CLT states that sample means are distributed normally!!!
not that individual observations are normal but that the sample means are normal!! so we can determine confidence intervals
how often will the values fall between the
mu +- one standard deviation
just over 2/3 of the time, 68.3%
how often will the values fall between the
mu +- two standard deviation
19/20, 95.4%
how often will the values fall between the
mu +- three standard deviation
99.7% of the time
what are the 4 requiremnts to calculate the conf int
1) make sure sample means are normally distributed (by clt)
2) sample mean
3) sample sd
4) the conf level associated w ur desired interval (90,95,99)
what is the formula for the conf int
sample mean +- z value * MSE
get MSE from the output (Sd/square root of n)
and z value is from the conf level of interest
zvalues
90=1.645
95=1.960
99=2.575
what is the MSE
MSE= sample sd/ Sqrt(n)
get it from simulaiton output
how to interpret the confidence intervals- IF 90% conf level
that there is a 90% chance that the unknown POPULATION MENA (Total cost) is between these two upper and lower bounds
THE INTERVALS ARE HIGHERS FOR THE HIGHER CONFIDENCE INTERVAL, so does this mean higher confidence level= higher certainty
no
WHAT IS THE TRADEOFF in conf intervals
certainty vs size of interval
as size of interval goes up, certainty goes down
as size of interval goes down, certianty goes up
how to do proportion conf ints
you use formula
pbar +/- Z(sqrt(pbar1-pbar)/n)
pbar= the percentage of the side you care about!!! convert % to decimals!!! 5.49 has an example
when do we use pbar
when we have yes/no scenario!!! this can be from a mean expected problem too!!
proportion value sampling risk:
sampling risk is the possibility that the poll (sample) is not representative of the true numbers
how to do proportinos in @risk
STEPS
- find what the cutoff value is
- if lower tail prob, then drag the left triangle to abs left
- if upper tail prob, then drag the right triangle to abs right
- MIND THE VALUES!!! UNITS IS IT IN MILLIONS OR??
- Look at the bars of prob above the results!! get the prob of the sides from there :)
remember to write it as avg expected probability!!!!
- do conf ints w formula if needed (pbar is the % of the side you care about!!!! ) PBAR IS FOUND IN THE RED BAR
how do we compare alternatives with @risk
we use the paramameter/changing cell! (the yellow cell that we can control )
why do we set a fixed seed value when we compare alternatives in @risk
-how does this help us compare alts?
because then you have a set of 1000 numbers that will be the same even if u keep running
because a fixed seed value ensures that the difference in the output is only due to controllable decisions NOT cuz a diff set of numbers
What does the advanced senstitvity analysis do?
automate the process for comparing the costs for setting diff seed values
when you do sensitivty analysis, what parts of the output do you care about
only the value and the mean
pros of simulation
-straightforward, flexible
-analyze large and complex situations
-What if analysis can be done
analyze large and complex situations, do what-if analysis withuot interfering with the system!
can examine interactive effects and scenarios that may not happen in other models
cons of simulation
-expensive, long
-they do not generate optimal solutions to problems (We choose the best from the paraments selected)
-managers must generate all conditions
-each model is unique and not transferable
Any uncertainty in the input cells flows through the spreadsheet model to create a related uncertainty in the value of the output cell(s).
To simulate a model, random number generators (RNGs) are used to select representative values for each uncertain independent variable in the model.
The variability and distribution of the sample values for the dependent variable(s) can then be analyzed to gain insight into the possible outcomes that might occur.
Any uncertainty in the input cells flows through the spreadsheet model to create a related uncertainty in the value of the output cell(s).
To simulate a model, random number generators (RNGs) are used to select representative values for each uncertain independent variable in the model.
The variability and distribution of the sample values for the dependent variable(s) can then be analyzed to gain insight into the possible outcomes that might occur.
what is the point estimate
-where DO WE GET THIS
-IS THIS WHAT WE CARE ABOUT??
-how do we convert xbar to mu?
the sample mean, THE Xbar
this is what the simulaiton will give us!!! but we dont care about this sample mean, we want the POPULATION MU!!!!!!
-use confidence intervals
what is the point estimate
-where DO WE GET THIS
-IS THIS WHAT WE CARE ABOUT??
-how do we convert xbar to mu?
the sample mean, THE Xbar
this is what the simulaiton will give us!!! but we dont care about this sample mean, we want the POPULATION MU!!!!!!
-use confidence intervals
what is the point estimate
-where DO WE GET THIS
-IS THIS WHAT WE CARE ABOUT??
-how do we convert xbar to mu?
the sample mean, THE Xbar
this is what the simulaiton will give us!!! but we dont care about this sample mean, we want the POPULATION MU!!!!!!
-use confidence intervals
sample proportion
- the prop of observations in the sample that live above/below cut off value are called sample proportion
likelihood of a loss
population proportion
-the unknown proportion of observations in the population that lie above or below the cut off is called the population proption
If we are asked to compare decision alternatives, how do you do this?
STEPS
We can automate this process by doing advanced sensitivit analysis, changing the yellow cell
5.51-
1) click yellow cell, go to simulate, and then click advanced sensitivity analysis, check that the “cell” val is correct (the blue cell)
2) Click + on the right, and then cell based input type, location shhould be the yellow cell
3) Under variation, click method “min max range”, number of steps should be 7, OK
4) Click additional options, in sensitivity options select the Summary, and then active workbook
5) Click analyze and run the simulaiton
copy the mean and value table, format it
How to format sensitivty table
1) make sure to use currency, not accounting
2) have a main title
3) col title centred and text wrapped, all #s centered
4) choose line chart, NOT PIVOT TABLE
5) have chart titles, axis title, axes, Label it X vs Y chart (not really x and y but label the names)
6) Have a final statement
WHAT IS THE CONCLUSION YOU SHOULD FIND FROM THE CHART!!! what should shape be
FOR COST DECISION: have a decrease followed by increase, PICK THE LOWEST VALUE ( this is like a parabola)
FOR PROFIT/CONTRIBUTION DECISION: the curve must increase than decrease, pick the highest VALUE (This is like an N)
OPPORTUNITY COST FORMULA
SALE PRICE-COST TO PURCHASE
INCLUDE DECIMALS IN THE FINAL CALCULATIONS
!!!!
sometimes logic functions are jsut simple!!!!
like subtraction and addition!
pbar not working?
check if u are working with emans then u wont have it!!
YOU CAN FIND PROPORTIONS and MEANS from the same graph outputs!!!
!!!
what is n in simulation??
of iterations we run
the higher the Z Value
THE WIDER THE CONF INTERVAL
Discountd by 60%?
sold at 40% * orig price