📚 The CoCalc Library - books, templates and other resources
License: OTHER
Optimization Review
Notebook for the Public Finance course, UCSC, AY 2018/2019 by Duccio Gamannossi degl' Innocenti. You can find more information on the course here.
1. Introduction
Economist usually assume that individuals seek to maximize their utility by making optimal choices given the constraints they face (e.g., individual's budget to be allocated between different goods, hours in a day to be devoted to work or leisure, etc.). This notebook provides a brief illustration of some methods to be used to solve the optimization problems considered during the course Public Finance (UCSC A.A. 2018/2019).
Note that these methods, while working in the simple setting considered in the course, might be unable to deliver results in particular cases.
2. Uncostrained Optimization
In this course, only well-behaved utility function will be considered. We are generally speaking about a function that in the univariate case is twice differentiable with .
In this simple setting, if a well-behaved objective function has an interior optimum, it will be at a point where its first derivative relative to the variable of choice is equal to .
This follows from:
A derivative equal to zero identifies a point where the slope changes of sign.
Given that the sign can only change from positive to negative
A maximum is reached when switches sign from positive to negative.
Starting from a point where (the utility increases when its argument raises) subsequent increases in deliver diminishing marginal increases in (due to ). For a given it will be that (an increase in will deliver no increase in utility) so that for any higher value of the argument utility will get lower by increasing (given that ). Hence, is a maximum.
Given that the derivative represents the slope of the curve of the function with respect to the variable of choice, we can give a simple graphical representation of this behaviour (see below). Drawing the function on the axes versus the , it is that when the curve goes up from left to right until where it stops increasing. For any point at the right of the curve of is downward sloping.
In order to solve an unconstrained optimization problem:
Define the function to be maximized
Evaluate the , i.e., the derivative of the function with respect to the choice variable
Set and solve for the choice variable
A simple unconstrained utility maximization problem
We want to find the optimal consumption of coffe for a student at UCSC. As we know, the coffe price is euro. We are considering a particular student who feels awful before her first coffe in the morning, enjoys less and less every additional coffe and starts shaking due to caffeine when taking more than five in a day. Then, we could model her utility from coffee as . The problem of our student is then to maximize her objective function where is the amount of coffe consumed.
The first step in the analysis is to define the Utility function and the Objective function:
We might want to explore the problem visually, so to have a better idea about it.
From the graph we can see that the optimal quantity of good, is around . As we previously stated, the maximum will be at the point where the slope of the Objective function is equal to zero.
We can then compute the , equate it to zero and solve for to identify precisely the optimal quantity.
So it is . So it seems that our student of interest will usually get a couple coffe, which sounds about right. We already know from the plot that the is identifying a maximum, but we can express it more concisely by reporting the :
During the course we will generally assume interior so you will not need to worry about second order conditions
3. Constrained Optimization
In this course we will only deal with choices over two goods at most. The general form of these constrained optimization problem is:
That we can define in SageMath as:
Here are presented three strategies to solve this problem:
A - Substitution
B - Lagrangean optimization
C - The Equimarginal principle
A - Substitution
An optimization problem in two variables where the constraints define a relation between the two goods, can be restated as a single variable one by substitution. Indeed, once the quantity of the first good is chosen so it is the money left to be spent on the other. Chosing then implies a choice for and the two-variable maximization problem boils down to the optimal choice of just one of them.
Analytically, in order to characterize the solution to the problem using substitution:
Use the constraints of the problem to identify the relationship between the two goods (that is, the budget constraint). Let's express as a function of .
Substitute in the objective function (i.e. ) with the expression obtained in point 1 so to restate the problem as an unconstrained single-variable one (the constraint is now embeeded into the objective function due to the substitution).
Solve the problem as an uncostrained maximization one by computing the and imposing .
Algebraically, it is:
1. Identify the relationship between the two goods
Define the second constraint
Solve the constraint for
2. Substitute in the objective function
3. Solve the problem as an uncostrained maximization one
Here, the notation stands for the derivative of the function relative to argument in the position. We can get back to the usual (Leibniz) notation:
That can be re-arranged as:
So, the solution of this problems will be such that
The optimal quantity of good consumed will be to satisfy the budget constraint
The optimal quantities of goods consumed needs to satisfy the condition
We will get back to the interpretation of the second point soon.
B - Lagrangean Optimization
An alternative method for optimization is the Lagrangean method. This technique allows to embed the budget constraint in the maximization and is particularly useful with choices involving more than two goods.
Analytically, in order to characterize the solution to the problem using the Lagrangean method:
Collect the terms of the budget constraint on one side - we will refer to this expression as .
Define the Lagrangean Function by adding multiplied by the lagrangean multiplier to the objective function of the problem
Evaluate the of this new problem (relative to the variables ) and solve the system to characterize the solution.
1. Use the constraints to restate the budget constraint
2. Define the Lagrangean Function
3. Evaluate the FOC
The system {, , } provides a characterization of the solution.
In particular, implies a binding budged constraint. Moreover, by inspecting and we can see that :
Equation can be re-arranged
similarly, for equation it is
and, equating we get:
the same condition stated in . These conditions are particular case of:
C - The Equimarginal principle
The equi-marginal principle states that maximization of a given objective function is attained when the allocation of resources among different alternatives is such that the utility derived from the last unit of money spent on each is equal. In our setting, the individual will maximize his objective function when the marginal utility per euro spent is the same across the goods he can buy.
We can rewrite this condition as:
Where the left-hand-side is the marginal rate of substitution, the rate at which the consumer is willing to trade off between the two goods). This condition has a simple graphical interpretation: it identifies the solution as the point where the slope of the indifference curve is the same of the slope of the budget constraint .