Download Quantative Ag-Econ

Document related concepts

Discrete choice wikipedia , lookup

Choice modelling wikipedia , lookup

Transcript
Quantitative Economics
SAB – 107
M-W: 11.00 am – 12.15 pm
Fall 2016
Instructor: Sankalp Sharma
Who am I?
A word on my teaching philosophy
About this Class
- In-class expectation
- Out-of-class expectation
- Homework
- Grading
In-class Expectation
- Key to learning: interaction
- Review previous class’ notes before class (same file will be updated)
- Attend all classes (cannot emphasize enough)
Ask questions…
But don’t be a troll!
No cellphones or laptops during the class !!
Out-of-class Expectation
- No gains without practice.
- Reading not enough, you must practice problems.
- Form groups to practice.
- Understand concept, memorization won’t help you.
Homework
- Frequently assigned.
- Usually only one question.
- A random student will be asked to solve the HW on the
board.
Grading
- Exams will be long and difficult.
- Everything taught in class is fair game.
- But grading will be easy.
- 40% midterm, 40% final, 20% HW, (bonus: 20% class interaction)
Questions?
The Road Map Ahead
Math Primer
Statistics Primer
Demand theory: Mathematical Application
Producer theory: Mathematical Application
Simple and Multiple Linear Regression
Math Primer
- Calculus training.
- Functions (single & multiple variables).
- Implicit Functions.
- Maximization of a function of one variable.
Statistics Primer
- Probability theory
- Discrete Random Variables & Their Probability
Distributions
- Continuous Random Variables & Their
Probability Distributions
- Hypothesis Testing
Demand theory: Mathematical Application
- Preferences & Utility
- Utility Maximization
- Income & Substitution Effects
- Demand Relationships Among Goods
Producer theory: Mathematical Application
- Production Functions
- Cost Functions
- Profit Maximization
Simple & Multiple Linear Regression
- Linear Statistical Models
- The Method Of Least Squares
- Properties of the Least Squares Estimator
- Inferences Concerning the Parameters
So let’s begin…
Functions
- Best explained using real life examples.
- Consider an industry producing chips:
- For $2 you can buy a packet, for $4 you can buy 2 packets.
How do we show this graphically?
A simple graph, explaining a function
y
$4
$2
1
2
x
Did you all get that?
Mathematical form
Y = f(x)
y
$4
Here, it is:
$2
Y = 2x
1
2
x
When x = 0, y = ?
x = 1, y = ?
x = 2, y = ?
Mathematical form
Y = f(x)
y
$4
Here, it is:
$2
Y = 2x
1
2
x
When x = 0, y = 0
x = 1, y = 2
x = 2, y = 4
Quick Mathematical Notation:
x0 = 1
x1 = x
x2 = x ∗ x
1
2
𝑥 = 𝑥 = 𝑥 0.5
A different example
Draw a graph for the following functions:
y = x2
y = 2x + 2
y = x 2 + 4x + 4
So what did you find?
Implicit function
- Same idea, just the opposite variable.
So if y = f(x), then we need to find the functional form of x = f(y)
..and how do you find that?
Implicit Function: Example
Earlier we had: y = 2x,
Implicit function:
x=
y
2
Implicit functions: your turn
Find the implicit function, for the previous examples:
y = x2
y = 2x + 2
y = x 2 + 4x + 4
Is there even a point to all this?
- Once you understand a function…
… you have to understand the shape and structure of a function.
y
slope
$4
$2
1
2
x
Key concept  slope of a function
Slope
- Figuring out the slope, would allow us to reach the maximum point of
a function.
- The slope of a function differs with a different value for “x”.
- How do we find a slope of a function such f(x), differential calculus
But why are we interested in reaching the
maximum point of a function?
- Well because “utility” is typically a function.
- Wait what?...
- Where did “utility” come from?
What is utility?
What is utility?
 It is a set of preferences.
What does a typical utility function (U) look like?
U(.)
Food, wealth,
health, etc.
What does “my” utility function look like?
U(.)
Food, travel, health,
swimming, relationship
with significant other,
Game of Thrones
Utility: The higher the better
Utility: In-depth
- In real life difficult to measure someone’s level of utility
- Think of water (measured in gallons)
- But how does one measure somebody’s satisfaction level.
- For eg: you eat two cups of ice-cream, can you tell me how
“happy you are” vs. when you have three cups?
Utils
- Is the scale used to measure utility. (For eg: a scale of 1 to
10)
- It is an arbitrary scale
- No real-life meaning.
- Still useful to get a sense of someone’s level of utility.
Utils: No real life interpretation without
context
- For eg: Let’s say Papa Johns comes up with a new Pizza.
- Most likely, you will tell your friend how many slices you ate
and whether you liked it or not.
- … and not whether you received 7 utils or 10 utils from it.
Utility: Mathematical Representation
- Suppose there are two types of pizzas:
Papa Johns and Dominoes.
Utility value = quantity of papa johns pizzas
2
A different utility value:
*Utility value = √(quantity of papa johns pizzas)
Utility value = y, quantity of papa johns pizzas = x
Introduction to Differentiation
- … And nothing more.
Consider the previous function:
y = √x
Or, y = x
1
2
Rules of differentiation:
1
d
1
y = × x 2−1
dx
2
Steps involved:
- Step 1: Bring the power of x “down” and multiply with x, like this:
1
2
1
2
y = x ,  then, differentiation leads to × x
1
2
And, step 2: subtract 1 from the exponent/power. So,
1
d
1
y = × x 2−1
dx
2
…and viola! You are done.
Practice Problems:
Let’s return to our previous problems:
y = x2
y = 2x + 2
y = x 2 + 4x + 4
Homework 1: Functions & Differentiation
Graph the following functions:
1) y = 3x + 4x 2 + 7
2) y = 𝑥
3) Write the implicit function of the above functions:
Differentiate the following functions:
𝑦 =
𝑥4
1
3
+
𝑥3
3
2
+
𝑥
2
𝑦 = 𝑥 +𝑥 +1
Now that we have mastered Differentiation, let’s
find the maximum value of a function.
….using differentiation
Midterm
October 26th 2016: Wednesday
Finding the value that maximizes a function
- Intuition: Suppose you are going up a hill.
- The slope is …?
- When you are at the top, the slope is…?
Finding the value that maximizes a function
- Intuition: Suppose you are going up a hill.
- The slope is …?
- When you are at the top, the slope is…?
- The slope is zero.
Finding the value that maximizes a function
- Therefore, we equate the differentiated function to zero
- And then solve for the variable.
Find “x”, which maximizes the following function:
1) y = 4𝑥 2 − 5𝑥 + 7
2) 𝑦 =
1 3
𝑥
3
3) 𝑦 = 2𝑥
+ 2x 2 + 4x
Is the value really the maximum?
- Test whether a function is really the maximum.
- Take double differential of equation.
- If optimal function is less than zero, then the value indeed maximizes
the function.
Example: Checking if indeed maximum
1 3
x −x
3
𝑑
𝑦 = 𝑥2 − 1 = 0
𝑑𝑦
𝑥 = ±1
y=
Take, second differential of we get,
2𝑥
First put x = 1, we get :
2 1 >0
Not a maximum
Now put x = -1
2 −1 < 0
Conclusion: x=-1 maximum,
Visually, you can see…
y
x
- Technically
x = -1 is called a “local maximum”
However, for our purposes, you don’t have to worry about that.
Practice: Check the maximum for the previous
problems.
1) y = 𝑥 2 − 2𝑥
2) y = 3x + 4x 2 + 7
Statistics Primer
- Math helps formulate an “idea” into a concrete structure.
- Statistics helps test the validity of the “idea” by using empirical
methods.
Statistics Primer
Let’s start with the basics:
- What is “Mean”?
- What is the “Median”?
- What is “Mode”?
- What is “variance”?
- What is “standard deviation”?
Mean
- Simply the average of a set of numbers:
- The “mean” of the following group of numbers is:
- 1,89, 34, 12, 60, 7?
Median
Is the mid-point of a set of numbers.
5, 20, 1, 99, 7
What is the median when the set is:
20, 1, 99, 7
Mode
Is defined as the number that occurs the most.
What is the mode here?
c
What is the mode here:
3, 9, 6, 6, 5, 9, 3
What is the mode here?
1, 2, 3, 4
Variance
Explains the spread of the data.
Formula  𝜎 2 = ∑ 𝑥𝑖 − 𝜇 2 /𝑁
Find the variance of the following set of numbers:
6, 3, 9, 6, 6, 5, 9, 3
Variance & SD: Steps
- Find the “mean” of the set of numbers (𝜇)
- Find the total numbers in the set (N) .
- Find deviation and square them.
- Calculate 𝜎 2 .
- Take square root to find 𝜎
Solution
Deviation
𝑥𝑖 – 𝑢
𝑥𝑖
6
0.125
𝑥𝑖 − 𝑢
2
0.015625
3
-2.875
8.265625
9
3.125
9.765625
6
0.125
0.015625
6
0.125
0.015625
5
-0.875
0.765625
9
3.125
9.765625
3
-2.875
8.265625
5.875
Use formula:
36.875
Variance (𝜎 2 ) =
36.87
5.87
SD (𝜎) = 2.503
= 6.27
Find the variance and sd of the following set
of numbers
1) 1,89, 34, 12, 60, 7?
2) 5, 20, 1, 99, 7
Solution for 1)
Solution for 2)
Probability
Definition: “The chance of an occurrence of an event”.
Example: “What is the probability of raining today?”
“What is the probability that you will get an A in this class”?
Probability
- Probability is bounded between 0 and 1.
- A probability of 0 means the “event” cannot occur.
- A probability of 1 means the “event” will occur.
All probabilities lie between: 0 ≤ 𝑝 ≤ 1
Probability
Example: Suppose there is a bag containing only a partial deck of cards,
with only suits of Spades and Clubs.
If you were to draw a card, what is the probability that you pick a red
card?
…and what is the probability that you pick a black card?
The Sum of all probabilities must equal 1
Example: Suppose that the probability of a girl being born is 0.5 (or
Then the probability of a boy being born is?
How would we write this?
We know that
Therefore,
𝑃 𝑔𝑖𝑟𝑙 = 0.5
𝑃 𝑏𝑜𝑦 + 𝑃 𝑔𝑖𝑟𝑙 = 1
𝑃 𝑏𝑜𝑦 = 0.5
1
).
2
Probability Specifics:
- Experiment: Activity with an observable result.
- Trials: Simply a repetition this event.
- Outcomes: Simply the result of each trial.
- Sample space: The set of outcomes.
- Sample point: Elements of sample space.
- Event: Subset of the sample space
Example:
Suppose Rick Grimes is at a gun range. There is a plastic bottle dangling
about 25 meters away from the spot, where you are supposed to start
shooting from.
Experiment: Rick is going to start shooting, knowing that he could
either hit or miss.
Trial: Every shot he takes is a trial.
Outcome: For every shot, he either hits or misses.
Sample Space: The collection of hits and misses.
Example: Explained further
- Suppose Rick took 2 shots with his gun?
What is the sample space?
SS = {HH, HM, MH, MM}
*H = Hit, M = Miss
Event: That he hits twice? 𝑛 𝐴 =?
Number of elements in SS = ?
Example: Explained further
- Suppose Rick took 2 shots with his gun?
What is the sample space?
SS = {HH, HM, MH, MM}
*H = Hit, M = Miss
Event (A): That he hits twice? 𝑛 𝐴 = 1
Number of elements in SS = 4
Finding the probability: Main Formula
𝑃 𝐴 =
𝑛 𝐴
𝑛(𝑆)
So from the previous slides: The probability that Rick hit the bottle both
times is?
𝑛 𝐴
1
𝑃 𝐴 =
=
𝑛(𝑆) 4
Practice Problems
1) What is the probability that Rick hits exactly once?
2) What is the probability that Rick misses exactly once?
3) What is the probability that Rick misses both times?
Homework 2:
- Suppose now Rick takes 3 shots.
1) Write down his sample space?
2) What is the probability that he hits all three times?
3) What is the probability that he never hits?
More challenging one!
4) What is the probability that he hits at least once?
Finding all sample points
When Rick shot twice, how did we find all sample points?
Finding all sample points
When Rick shot twice, how did we find all sample points?
Consider the number of outcomes at each shot: Hit or Miss.
Multiply total outcomes with each other.
Question:
Let’s say Rick now throws a pair of die:
1. Use the combinatorial theorems to determine the number of
sample points in the sample space S.
2. Find the probability that the sum of the numbers appearing on the
dice is equal to 7.
Solution?
More basic practice
- How many different seven-digit telephone numbers can be formed if
the first digit cannot be zero?
Q: What is the probability that the 5th and 7th digits both have the
number 1.
The Combination Formula
𝑛𝐶𝑟
For example: (10𝐶2 ) =
10!
2! 10−2 !
𝑛!
=
𝑟! 𝑛 − 𝑟 !
=
10×9×8!
2!×8!
= 45
Useful for finding total sample events in selection problems.
Let’s look at More Questions
Q: Consider the problem of selecting two applicants for a job out of a
group of five and imagine that the applicants vary in competence, 1
being the best, 2 second best, and so on, for 3, 4, and 5. These ratings
are of course unknown to the employer.
1. Find the probability the employer selects the best and one of the
two poorest applicants?
2. The employer selects at least one of the two best?
Solution?
- I would start with writing down all sample points.
- Just taught you an easy formula to verify that you are correct.
Question:
A group of three undergraduate and five graduate students are
available to fill certain student government posts. If four students are
to be randomly selected from this group, find the probability that
exactly two undergraduates will be among the four chosen.
Question: More Challenging!
1) If the first 2 cards are both spades, what is the probability that the
next 3 cards are also spades?
2) If the first 3 cards are all spades, what is the probability that the
next 2 cards are also spades?
3) If the first 4 cards are all spades, what is the probability that the
next card is also a spade?
Review of Set Theory
• Let A and B be two sets:
A
B
Set Theory: Important Concepts
Let S be the sample space of which both A and B are part of.
1) 𝐴 ⊂ 𝐵 : A is a subset of B. (Example?)
2) 𝐴 ∪ 𝐵 : is the “union” of A and B. (Example?)
3) 𝐴 ∩ 𝐵 : is the “intersection” of A and B. (Example?)
4) 𝐴 ∪ 𝐴 = 𝑆: everything not part of A is part of its “complement”.
Question:- Find the following relations:
A = {1,2,3,4,5,6}, B={4,5,6,7,8}
1) 𝐴 ∪ 𝐵
2) 𝐴 ∩ 𝐵
3) 𝐴
Set Theory: Distributive Laws
1) 𝐴 ∩ 𝐵 ∪ 𝐶 = 𝐴 ∩ 𝐵 ∪ 𝐴 ∩ 𝐶
2) 𝐴 ∪ 𝐵 ∩ 𝐶 = 𝐴 ∪ 𝐵 ∩ 𝐴 ∪ 𝐶
Prove the above laws for the previous examples:
A = {1,2,3,4,5,6}, B={4,5,6,7,8}
Conditional Probability
- The conditional probability of an event A, given that an event B has
occurred, is equal to:
𝑃 𝐴∩𝐵
𝑃 𝐴𝐵 =
𝑃(𝐵)
provided P(B) > 0. The symbol P(A|B) is read “probability of A given B.”
Also, 𝑃 𝐵 𝐴 =
𝑃 𝐴∩𝐵
𝑃(𝐴)
Example:
Q: Suppose that a balanced die is tossed once. Find the probability of a
1, given that an odd number was obtained.
Independent Events
- Two events are said to be independent, if anyone of the following
holds:
1) P(A|B)=P(A)
2) P(B|A)=P(B)
3) P(A∩B)=P(A).P(B)
Homework 3
Q: If two events, A and B, are such that P(A) = .5, P(B) = .3, and P(A ∩ B)
= .1, find the following:
1) P(A|B)
2) P(B|A)
3) P(A|A ∪ B)
4) P(A|A ∩ B)
5) P(A ∩ B|A ∪ B)
Question for Practice
Q: Suppose that a balanced die is tossed once. Find the probability of a
1, given that an odd number was obtained.
Recall Formula: 𝑃 𝐴|𝐵) =
𝑃 𝐴∩𝐵
𝑃(𝐵)
Steps
1) Define A and B correctly.
2) Find 𝑃(𝐴 ∩ 𝐵)?
3) Find 𝑃(𝐵)?
Plug in formula to solve.
Question: A more challenging one.
Q: A survey of consumers in a particular community showed that 10%
were dissatisfied with plumbing jobs done in their homes. Half the
complaints dealt with plumber A, who does 40% of the plumbing jobs
in the town. Find the probability that a consumer will obtain
1) an unsatisfactory plumbing job, given that the plumber was A.
2) a satisfactory plumbing job, given that the plumber was A.
Solution?
Steps:
1) Define events A and B
2) Find 𝑃 𝐴 ∩ 𝐵 ?
3) Find 𝑃(𝐵)
Solution
Define:
Let’s define P(B): as the probability that “plumber A” was the one who
came for the job.
Therefore P(B)=?
Solution
Define:
Let’s define P(A): as the probability that “plumber A” was the one who came
for the job.
Therefore P(A)=40%=0.4
Let’s define P(U) as the probability that an “unsatisfactory job was done”.
P(U)=?
Solution
Define:
Let’s define P(A): as the probability that “plumber A” was the one who came
for the job.
Therefore P(A)=40%=0.4
Let’s define P(U) as the probability that an “unsatisfactory job was done”.
P(U)=0.10
Solution?
𝑃 𝑈∩𝐴
P(U|A)=
𝑃(𝐴)
Answer?
=
𝑃(𝐴|𝑈)×𝑃 𝑈
𝑃(𝐴)
Solution?
𝑃 𝑈∩𝐴
P(U|A)=
𝑃(𝐴)
=
𝑃(𝐴|𝑈)×𝑃 𝑈
𝑃(𝐴)
Answer: 𝑃 𝑈 𝐴 =
0.1×0.5
0.4
= 0.125
Find part 2) of this question?
Question: A challenging one again!
Q: Articles coming through an inspection line are visually inspected by
two successive inspectors. When a defective article comes through the
inspection line, the probability that it gets by the first inspector is .1.
The second inspector will “miss” five out of ten of the defective items
that get past the first inspector. What is the probability that a defective
item gets by both inspectors?
Additive Law of Probability
The probability of the union of two events is:
𝑃 𝐴 ∪ 𝐵 = 𝑃 𝐴 + 𝑃 𝐵 − 𝑃(𝐴 ∩ 𝐵)
If A and B are mutually exclusive  𝑃 𝐴 ∩ 𝐵 = 0, then
𝑃 𝐴∪𝐵 =𝑃 𝐴 +𝑃 𝐵
Typically when we talk about:
𝑃 𝐴 ∪ 𝐵 −→ we are talking about the probability of A “or” B.
And,
𝑃 𝐴 ∩ 𝐵 −→ we are talking about the probability of A “and” B.
Intuition using graphs
A
B
You can see that the common area must be subtracted.
Practice Problems
- If A and B are independent events with P(A) = .5 and P(B) = .2, find
the following:
1) 𝑃 𝐴 ∪ 𝐵
2) 𝑃 𝐴 ∩ 𝐵
3) 𝑃 𝐴 ∪ 𝐵
Question:
Q: Can A an B be mutually exclusive if P(A) = .4 and P(B) = .7? If P(A) =
.4 and P(B) = .3? Why?
Question:
A smoke detector system uses two devices, A and B. If smoke is
present, the probability that it will be detected by device A is .95; by
device B, .90; and by both devices, .88.
1) If smoke is present, find the probability that the smoke will be
detected by either device A or B or both devices.
2) Find the probability that the smoke will be undetected.
Practice problems
Q: Diseases I and II are prevalent among people in a certain population.
It is assumed that 10% of the population will contract disease I
sometime during their lifetime, 15% will contract disease II eventually,
and 3% will contract both diseases.
1) Find the probability that a randomly chosen person from this
population will contract at least one disease.
2) Find the conditional probability that a randomly chosen person
from this population will contract both diseases, given that he or
she has contracted at least one disease.
Question
Suppose that there is a 1 in 50 chance of an injury on a single skydiving
attempt.
1) If we assume that the outcomes of different jumps are independent,
what is the probability that a skydiver is injured if she jumps twice?
2) Your friend Sirius claims if there is a 1 in 50 chance of injury on a
single jump then there is a 100% chance of injury if a skydiver jumps 50
times. Is your friend correct? Why?
Homework 4:
Q: In a game, a participant is given three attempts to hit a ball. On each
try, she either scores a hit, H, or a miss, M. The game requires that the
player must alternate which hand she uses in successive attempts. That
is, if she makes her first attempt with her right hand, she must use her
left hand for the second attempt and her right hand for the third. Her
chance of scoring a hit with her right hand is .7 and with her left hand
is .4. Assume that the results of successive attempts are independent
and that she wins the game if she scores at least two hits in a row. If
she makes her first attempt with her right hand, what is the probability
that she wins the game?
Midterm
-
October 26th (Wednesday), 11.00 am. Room 204
1 hour 15 mins.
Material covered upto today.
Revise every single slide of this file (minus the introductory slides).
Understanding every concept is key to scoring a high score.
Calculators will be required.
Cellphones Not Allowed in the Exam Room
Midterm
- If you have any questions, email me at:
[email protected]
Or drop by to ask in-person - Office: 118
As always, if the above two resources fail then, any question you have
can always be answered at: http://google.com
Histograms
- Covered last class.
- Make sure you understand the example discussed.
Random Variable
What is a random variable?
Random Variable (RV)
What is a random variable?
The answer follows from the name itself: A random variable is a
variable, which can take on any value.
Two types of random variables:
1) Discrete
2) Continuous
Discrete Random Variable
- A random variable Y is said to be discrete if it can assume only a finite
or countably infinite number of distinct values.
Eg: Think of a number of defective TV sets in a shipment of 100.
- In general, discrete RV often represent counts associated with real
phenomena.
Continuous RV
- RV’s where you can associate an infinite number of values, for any
given range.
Eg: think of time or distance as an example.
Probability Distribution for a Discrete RV
Try and understand the intuition through probability theory.
Notation: (Important to know)
𝑌: upper case letter  to denote a RV,
𝑦: lower case letter  to denote a particular value that the RV might
assume.
- Eg: let Y denote any one of the six possible values that could be observed
on the upper face when a die is tossed.
Probability Distribution of an RV
- The expression (Y = y) can be read, the set of all points in S assigned
the value y by the random variable Y.
- Now think terms of probability:
- The probability that Y takes on the value y, P(Y = y), is defined as the
sum of the probabilities of all sample points in S that are assigned the
value y.
- Sometimes P(Y = y) is denoted by p(y).
Probability Distribution of an RV
The probability distribution for a discrete variable Y can be
represented by a formula, a table, or a graph that provides 𝒑(𝒚) =
𝑷(𝒀 = 𝒚) for all y.
Probability Histogram
0.70
Eg:
0.60
0.50
P(Y=y)
0
1/5
1
3/5
0.20
2
1/5
0.10
p(y)
y
0.40
0.30
Frequency
0.00
0
1
2
y
More
Discrete Probability Distribution: Properties
-0≤𝑝 𝑦 ≤1
- ∑𝑛𝑖=1 𝑝 𝑦 = 1  summation is over all values of y with non-zero
probability.
y
P(Y=y)
0
1/5
1
3/5
2
1/5
Sum
1
Question:
Q: A supervisor in a manufacturing plant has three men and three
women working for him. He wants to choose two workers for a special
job. Not wishing to show any biases in his selection, he decides to
select the two workers at random. Let Y denote the number of women
in his selection. Find the probability distribution for Y.
Go step by step:
1) Find total sample points.
2) Then try and understand how many values 𝑌 can take (that is y).
3) Find 𝑃(𝑌 = 𝑦) for each 𝑦, which is the probability distribution
More Practice Problems
When the health department tested private wells in a county for two
impurities commonly found in drinking water, it found that 20% of the
wells had neither impurity, 40% had impurity A, and 50% had impurity
B. (Obviously, some had both impurities.) If a well is randomly chosen
from those in the county, find the probability distribution for Y , the
number of impurities found in the well.
Hint: Think in terms of “unions” and “intersections”
A Challenging one!
You and a friend play a game where you each toss a balanced coin. If
the upper faces on the coins are both tails, you win $1; if the faces are
both heads, you win $2; if the coins do not match (one shows a head,
the other a tail), you lose $1. Give the probability distribution for your
winnings, Y , on a single play of this game.
The Expected Value of a Random Variable
Probability distribution for a random variable is a theoretical model for
the empirical distribution of data associated with a real population.
-The Expectation is nothing but the mean of the said RV.
Mathematical notation
- Let Y be a Discrete RV, then:
The “expectation” of Y is:
𝐸 𝑌 =
𝑦𝑝(𝑦)
𝑦
Best explained using an example
Find the expectation of the previous 3 examples:
1)
2)
3)
Expectations generalized
Some times you would need to find the expectation of a function of a
RV. In that case:
𝐸 𝑔 𝑌
=
𝑔 𝑦 𝑝(𝑦)
𝑦
Where,
𝑔 𝑌 = 𝑌2 + 𝑌
Properties of Expectation:
1) 𝐸 𝑎𝑋 = 𝑎𝐸 𝑋  where ‘a’ is some constant.
2) 𝐸 𝑎𝑋 + 𝑏𝑌 = 𝑎𝐸 𝑋 + 𝑏𝐸(𝑌)  ‘b’ some constant
3) 𝐸 𝑎 = 𝑎
Let’s look at some problems.
- Let Y be a random variable with p(y) given in the accompanying table.
Find E(Y ), E(1/Y ), E(𝑌 2 − 1)
y
P(Y=y)
1
0.4
2
0.3
3
0.2
4
0.1
Sum
1
Variance of a RV
Formula:
𝑉 𝑌 =𝐸 𝑌−𝐸 𝑌
Also written as:
𝑉 𝑌 = 𝐸 𝑌2 − 𝐸 𝑌
2
2
- Find V(Y) in the previous example:
Another example
The maximum patent life for a new drug is 17 years. Subtracting the length of time
required by the FDA for testing and approval of the drug provides the actual patent
life for the drug—that is, the length of time that the company has to recover
research and development costs and to make a profit. The distribution of the
lengths of actual patent lives for new drugs is given below:
Years 3
p(y)
4
5
6
7
8
9
10
11
12
0.03 0.05 0.07 0.10 0.14 0.20 0.18 0.12 0.07 0.03
1) Find the mean patent life for a new drug.
2) Find the standard deviation of Y = the length of life of a randomly selected new
drug.
3) What is the probability that the value of Y falls in the interval μ ± 2𝜎?
More practice
Q: A single fair die is tossed once. Let Y be the number facing up. Find
the expected value and variance of Y.
Further Practice
In a gambling game a person draws a single card from an ordinary 52card playing deck. A person is paid $15 for drawing a jack or a queen
and $5 for drawing a king or an ace. A person who draws any other
card pays $4. If a person plays this game, what is the expected gain?
Continuous Random Variables
- Let Y denote any random variable. The distribution function of Y ,
denoted by F(y), is such that F(y) = P(Y ≤ y) for −∞ < y < ∞.
- The latter term (−∞ < y < ∞) is known as the support of the random
variable.
Key difference from the Discrete Case
- P(Y=y) = 0
- The reason being that Y is continuous.
- Else we would have a discontinuity jump at point y.
Continuous RV: Continued
- F(y) is known as the distribution function of Y.
Refresher, we have already found F(y) for the Discrete case.
In the continuous case:
𝑦
𝐹 𝑦 =
𝑓 𝑦 𝑑𝑦
∞
Normal Distribution
- Life begins and end with this distribution.
- By far the most common used distribution.
- According to the Central Limit Theorem: with a large enough sample
size: Any type of data is “Normally” distributed
Applied microeconomics
1. Utility Maximization.
2. Cost minimization.
3. Profit Maximization (perfect competition and monopoly).
Utility Maximization
- Everything that we have learnt so far will be utilized here.
- Make sure that you understand utility.
- And differentiation.
The Lagrangian Method
- In mathematical optimization, the method of Lagrange multipliers (named
after Joseph Louis Lagrange) is a strategy for finding the local maxima and
minima of a function subject to equality constraints.
- Whole idea in a nutshell:
𝑀𝑎𝑥
𝑓(𝑥)
𝑥
Subject to:
𝑔 𝑥 =𝑔
Lagrangian: Set-up
𝐿 𝑥, 𝜆 = 𝑓 𝑥 − 𝜆(𝑔 𝑥 − 𝑔)
Where 𝜆 is the Lagrange multiplier.
It explains the rate of the function 𝑓(𝑥) as the 𝑔 is increased.
Let’s dive right into it
Suppose Minerva Mcgonagall wants to maximize her utility subject to
her income: (2𝑥 + 3𝑦 = 10)
1)
2)
3)
4)
𝑈
𝑈
𝑈
𝑈
𝑥, 𝑦
𝑥, 𝑦
𝑥, 𝑦
𝑥, 𝑦
= 𝑥 2𝑦2
= 𝑥 2 + 𝑥𝑦 2
= 𝑥+ 𝑦
=𝑥+𝑦
Understanding the intuition
- Marginal Rate of Substitution equaling the price ratio.
- Utility functions
- Leontif.
- Cobb Douglas.
Homework
Suppose Albus Dumbledore wants to maximize his utility subject to his
income: 𝑥 + 4𝑦 = 16
1) 𝑈 = 𝑥 + 𝑦
2) 𝑈 = min(𝑥, 𝑦)
Indirect Utility function
Let 𝑈 𝑥1 , 𝑥2 , … , 𝑥𝑛 be some utility function
Then the indirect utility function is given by:
V(𝑝1 , 𝑝2 , … , 𝑝𝑛 ) = 𝑈(𝑥1∗ , 𝑥2∗ , … , 𝑥𝑛∗ )
Practice problems
Find the indirect utility functions for the previous problems.
Cost-Minimization
Here we minimize the consumer’s budget subject to some utility
function. Answer remains the same:
The Lagrangian is given by:
𝑀𝑖𝑛 𝐿 𝑥, 𝑦, 𝜆 = 𝑔 𝑥 − 𝜆(𝑈 𝑥, 𝑦 − 𝑈)
Linear Regression
Consider the following equation:
𝑌 = 𝑎 + 𝑏𝑋 + 𝜖
Interpretation: Increasing ‘X’ by 1, increases Y by amount ‘b’.
Assumptions:
1) 𝐸 𝜖 = 0, 𝑉𝑎𝑟 𝜖 = 𝜎 2
𝜕𝑌
𝜕𝑋
2)
=𝑏
3) 𝐸 𝑌 = 𝑎 + 𝑏𝑋