Download overhead - 08 Stochastic Variables

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Central limit theorem wikipedia , lookup

Transcript
Materials for Lecture 08
• Chapters 4 and 5
• Chapter 16 Sections 3.2-3.7.3
• Lecture 08 Bernoulli & Empirical.xls
• Lecture 08 Normality Test.xls
• Lecture 08 Parameter Est.xls
• Lecture 08 Normal.xls
• Lecture 08 Simulate a Reg Model.xls
Stochastic Simulation
• Purpose of simulation is to estimate the unknown
probability distribution for a KOV so decision makers can
make a better decision
– Simulate because we can not observe and measure the KOV
distribution directly
– Want to test alternative values for control variables
• Sample PDFs for random variables, calculate values of
KOV for many iterations
• Record KOV
• Analyze KOV distribution X
X and X are
X
1
2
Model
~
~
Y1 = f(M, Z, X 1 )
~
~
Y2 = f(M, X 2 , Y1 )
~
~ ~
Y3 = f(Y1 , Y2 )
Manageable
Variables
(Mi)
1
Exog Var (Zi)
P(Y3 )
Y1
Y2
2
Stochastic Variables
Y3
Stochastic Variables
• Any variable the decision maker can not
control is thought to be stochastic
• In agriculture we think of yield as
stochastic as it is subject to weather
• For most businesses the prices of inputs
and outputs are not directly controlled by
management so they are stochastic.
– Production may be random as well.
• Include the most important stochastic
variables in simulation models
– Your model can not include all random variables
Stochastic Simulation
• In economics we use simulation because we can
not experiment on live subjects, a business or the
economy without injury
• In other fields they can fabricate an experiment
– Health sciences they feed/treat multiple rats on different
chemicals
– Animal science feed multiple pens of steers, chickens,
cows, etc.
– Engineers run a motor under different controlled
situations (temp, RPMs, lubricants, fuel mixes)
– Vets treat different pens of animals with different meds
– Agronomists set up randomized block treatments for a
particular seed variety
• All of these are just different iterations of “models”
Iterations, How Many are Enough?
Specify
the output
variables’
names
and
location
Specify
the
number of
iterations
in the
Simetar
simulation
engine
• Change the number of iterations based on nature of the
problem -- 500 is adequate.
− Some studies use 1,000’s because they are using a
Monte Carlo sampling procedure which is less
precise than Latin hypercube
−Simetar uses a Latin hypercube so 500 is an
adequate sample size
Normal Distribution
• Normal distribution a continuous distribution that
produces a bell shaped distribution with set
probabilities
• Parameters are
– Mean
– Standard Deviation
• Normal distribution reaches to + and - infinity.
– Can produce negative values so be careful
– Can produce extremely high values
• Most of us have memorized several probabilities for
the normal distribution:
– 66% of observation within +/- 1 of the mean
– 95% of observation within +/- 2 of the mean
– 50% of observations lie above and below the mean.
Simulating Random Variables
• Normal distribution is used frequently, particularly when
simulating a regression model
• Parameters for a Normal distribution
– Mean expressed as Ῡ or Ŷ
– Standard Deviation σ (or SEP from a regression model)
• Assume yield is a random variable and have production
function data, such as:
– Ỹ = a + b1 Fert + b2 Water + ẽ
– Deterministic component is: a + b1 Fert + b2 Water
– Stochastic component is: ẽ
• Stochastic component, ẽ, is assumed to be distributed Normal
– Mean of zero
– Standard deviation of σe
• See Lecture 8 Simulate a Reg Model.XLS
PDF and CDF for a Normal Dist.
f(x)
Probability Density Function
F(x)
Cumulative Distribution Function
1.0
0.8
0.6
0.4
0.2
-
+
-
0.0
+
Use the Normal Distribution When:
• Use the Normal distribution if you have lots of
observations and have tested for normality
• Watch for infeasible values from a Normal
distribution (negative yields and prices)
-10.00
-5.00
0.00
5.00
10.00
15.00
20.00
25.00
Problems with the Normal
• It is easy to use, so it often used when it is not
appropriate
• It does not allow for extreme events (BS’s)
– No way to account for record breaking outliers because
the distribution is defined by Mean and Std Dev.
• Std Dev is the “average” deviation from the mean and
averages out BS’s
• Market outliers are washed away in the average
• It is the foundation for Sigma 6
– So it suffers from all of the problems of the Normal
– Creates a false sense of security because it never sees
a record braking outlier
Test for Normality
• Simetar provides an easy to use procedure for testing
Normality that includes:
–
–
–
–
–
S-W – Shapiro-Wilks
A-D – Anderson-Darling
CvM – Cramer-von Mises
K-S – Kolmogornov-Smiroff
Chi-Squared
• Simetar’s Hypothesis Testing Icon (Ho Hi) provides a tab to
“Test for Normality”
Simulating a Normal Distribution
• Normal Distribution
=NORM( Mean, Standard Deviation)
=NORM( 10,3)
=NORM( A1, A2)
• Standard Normal Deviate (SND)
=NORM(0,1) or =NORM()
• SND is the Z-score for a standard normal distribution
allowing you to simulate any Normal distribution
• SND is used as follows:
Ỹ = Mean + Standard Deviation*NORM(0,1)
Ỹ = Mean + Standard Deviation*SND
Ỹ = A1 + (A2 * A3) where a SND is in cell A3
Truncated Normal Distribution
• General formula for the Truncated Normal
=TNORM( Mean, Std Dev, [Min], [Max],[USD] )
• Truncated Downside only
=TNORM( 10, 3, 5)
• Truncated Upside only
=TNORM( 10, 3, , 15)
• Truncated Both ends
=TNORM( 10, 3, 5, 15)
• Truncated both ends with a USD in general form
=TNORM( 10, 3, 5, 15, USD)
Example Model of Net Returns for a Business Model
- Stochastic Variables -- Yield and Price
- Management Variables -- Acreage and Costs (fixed and variable)
- KOV -- Net Returns
- Write out the equations and exogenous values
Equations and their order
~
Y = Y +  * SND1
~
P = P +  * SND2
~
~
Rec = Y * P * Ac
~
Cost = (Ac * 150) + (0.25 * Y * Ac) + 10
NR = Rec - Cost
Program a Simulation Model in Excel/Simetar -Input Data Section of the Worksheet
1
2
3
4
5
6
A
VC / acre
VC / Y
Acre
Fixed Cost
Yield Mean & Std. Dev.
Price Mean & Std. Dev.
B
150.0
0.25
100
10
150
2
-See Lecture 08 Simulation Model with Simetar.XLS
C
30
0.40
Program Model in Excel/Simetar -- Generate Random Variables and Simulate NR
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
A
Stochastic Yield
Mean
Std. Dev.
SND
Random Yield
Stochastic Price
Mean
Std. Dev.
SND
Random Price
Receipts from Market
Yield
Price
Acres
Receipts
B
C
Formulas in Column B
150
30
0.362
160.86
= B5
= C5
= NORM ( )
= B14 + B15 * B16
2.00
0.40
-0.216
1.9136
= B6
= C6
= NORM ( )
= B19 + B20 * B21
160.86
1.9136
100
30782.16
= B17
= B22
= B3
= B24 * B25 * B26
Calculate Costs
Fixed Cost
VC/acre
VC/Y
Total
10
4000
2412.9
6422.9
= B4
= B1 * B3
= B2 * B17 * B4
= Sum (B30 : B32)
Net Returns
24359.26
= B27 – B33
Bernoulli Distribution
PDF for Bernoulli B(0.75)
CDF for Bernoulli B(0.75)
1
.25
.25
.75
0
1
X
0
1
X
PDF and CDF for a Bernoulli Distribution.
• Parameter is ‘p’ or the probability that the
variable is 1 or TRUE
• Simulate Bernoulli in Simetar as
= Bernoulli(p)
= Bernoulli(0.25)
Bernoulli Distribution
• Use Bernoulli in a conditional distribution as
demonstrated:
– It rains 20% of time during June and if it rains, the
amount is distributed U(0.1, 0.9)
Cell A2 =BERNOULLI(0.20)
Cell A3 =UNIFORM(0.1, 0.9) * A2
– Probability of mechanical failure is 5%, cost of repair
is $10,000, $20,000, or $30,000
Cell A4
=BERNOULLI(0.050)
Cell A5
=DEMPIRICAL(10000, 20000, 30000)
Cell A6
= A4 * A5