04 September, 2019

Creative
Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

\[ \def\indep{\perp\!\!\!\perp} \def\Er{\mathrm{E}} \def\R{\mathbb{R}} \def\En{{\mathbb{E}_n}} \def\Pr{\mathrm{P}} \newcommand{\norm}[1]{\left\Vert {#1} \right\Vert} \newcommand{\abs}[1]{\left\vert {#1} \right\vert} \DeclareMathOperator*{\argmax}{arg\,max} \DeclareMathOperator*{\argmin}{arg\,min} \]

Unconstrained optimization

Definitions and notation

\[ \max_{x \in U} f(x) \] where \(x \in \R^n\) and \(f:\R^n \to \R\)

  • Maximum \(F^* = \max_{x \in U} f(x)\) means \(f(x) \leq F^*\) for all \(x \in U\) and \(f(x^*) = F^*\) for some \(x^* \in U\)

  • Maximizer \(x^* \in \argmax_{x \in U} f(x)\) means \(f(x^*) = \max_{x \in U} f(x)\)

    • strict if \(f(x^*)>f(x)\) for all \(x \neq x^*\)
    • local if \(\exists \delta>0\) such that \(f(x^*) \geq f(x)\) \(\forall x\) with \(\norm{x-x^*}<\delta\)

  • Supremum \(S = \sup_{x\in U} f(x)\) means \(S \geq f(x)\) for all \(x\in U\) and for any \(A < S\), \(\exists x \in U\) such that \(f(x) > A\)

  • e.g.: \(1 = \sup_{x \in \R} \frac{e^x}{1+e^x}\)

First order condition

Let \(f: \R^n \to \R\), and suppose \(f\) has a local maximum \(x\) and \(f\) is differentiable at \(x\). Then \(\frac{\partial f}{\partial x_i} = 0\) for \(i = 1, ..., n\).

  • necessary, but not sufficient, e.g. \(f(x) = x^3\)

Second order condition

\[ f(x^*+v) \approx f(x^*) + Df_{x^*} v + \frac{1}{2} v^T D^2 f_{x*} v \] suppose \(Df_{x^*} = 0\), then \[ f(x^*+v) - f(x^*) \approx \frac{1}{2} v^T D^2 f_{x^*} v \] so local maximum if \[ \frac{1}{2} v^T D^2 f_{x^*} v < 0 \]

Definite matrices

Let \(A\) be a symmetric matrix, then \(A\) is

  1. Negative definite if \(x^T A x < 0\) for all \(x \neq 0\)

  2. Negative semi-definite if \(x^T A x \leq 0\) for all \(x \neq 0\)

  3. Positive definite if \(x^T A x > 0\) for all \(x \neq 0\)

  4. Positive semi-definite if \(x^T A x \geq 0\) for all \(x \neq 0\)

  5. Indefinite if \(\exists\) \(x_1\) s.t. \(x_1^T A x_1 > 0\) and some other \(x_2\) such that \(x_2^T A x_2 < 0\).

Second order condition

Let \(F: \R^n \to \R\) be twice continuously differentiable and let \(x^*\) be a critical point. If

  1. The Hessian, \(D^2 F_{x^*}\), is negative definite, then \(x^*\) is a strict local maximizer.

  2. The Hessian, \(D^2 F_{x^*}\), is positive definite, then \(x^*\) is a strict local minimizer.

  3. The Hessian, \(D^2 F_{x^*}\), is indefinite, \(x^*\) is neither a local min nor a local max.

  4. The Hessian is positive or negative semi-definite, then \(x^*\) could be a local maximum, minimum, or neither.

Constrained optimization

Equality constraints

\[ \max f(x) \text{ s.t. } h(x) = c \] where \(f: \mathbb{R}^n \to \mathbb{R}\) and \(h: \mathbb{R}^n \to \mathbb{R}^m\)

Equality constraints

Let \(f:\mathbb{R}^n \to \mathbb{R}\) and \(h: \mathbb{R}^n \to \mathbb{R}^m\) be continuously differentiable. Suppose \(x^*\) is a constrained local maximizer of \(f\) subject to \(h(x) = c\) and that \(Dh_{x^*}\) has rank \(m\). Then \(\exists\) \(\mu^* \in \mathbf{R}^m\) such that \[ \begin{aligned} \frac{\partial L}{\partial x_i}(x^*,\mu^*) = & \frac{\partial f}{\partial x_i} - {\mu^*}^T \frac{\partial h}{\partial x_i}(x^*) = 0 \\ \frac{\partial L}{\partial \mu_j}(x^*,\mu^*) = & h(x^*) - c = 0 \end{aligned} \] for \(i = 1, ..., n\) and \(j=1,...,m\).

Inequality constraints

\[ \max_{x} f(x) \text{ s.t. } g(x) \leq b. \]

Inequality constraints

Let \(f:\mathbb{R}^n \to \mathbb{R}\) and \(g: \mathbb{R}^n \to \mathbb{R}^m\) be continuously differentiable. Suppose \(x^*\) is a local maximizer of \(f\) subject to \(g(x) \leq b\). Suppose that the first \(k \leq m\) constraints, bind \[ g_j(x^*) = b_j \] for \(j = 1 ... k\) and that the Jacobian for these constraints, has rank \(k\). Then, there exists \(\lambda^* \in \mathbb{R}^m\) such that for \[ L(x,\lambda) = f(x) - \lambda^T (g(x) - b). \] we have \[ \begin{aligned} \frac{\partial L}{\partial x_i}(x^*,\lambda^*) = & \frac{\partial f}{\partial x_i} - {\lambda^*}^T \frac{\partial g}{\partial x_i}(x^*) = 0 \\ \lambda_j^* \frac{\partial L}{\partial \lambda_j}(x^*,\lambda^*) = & \lambda_j^* \left(g_j(x^*) - b \right)= 0 \end{aligned} \]

Complementary slackness

For each \(j\) if \(\lambda_j^* > 0\) then \(g_j(x^*) = b_j\) and if \(g_j(x^*) < b\), then \(\lambda_j^*=0\).

Comparative statics

Comparative statics

  • Value function \[ v(\theta) = \max_x f(x,\theta) \text{ s.t. } h(x,\theta) = c \]
  • Maximizer \[ x^*(\theta) = \mathrm{arg}\max_x f(x,\theta) \text{ s.t. } h(x,\theta) = c \] How do \(v\) and \(x^*\) vary with \(\theta\) ?

Envelope theorem

Let \(f:\mathbb{R}^{n+k} \to \mathbb{R}\) and \(h: \mathbb{R}^{n+k} \to \mathbb{R}^m\) be continuously differentiable. Define \[ v(\theta) = \max_x f(x,\theta) \text{ s.t. } h(x,\theta) = c \] where \(x \in \mathbb{R}^n\) and \(\theta \in \mathbb{R}^k\). Then \[ D_\theta v_\theta = D_\theta f_{x^*,\theta} - \mu^T D_\theta h_{x^*,\theta} \] where \(\mu\) are the Lagrange multipliers, \(D_\theta f_{x^*,\theta}\) denotes the \(1 \times k\) matrix of partial derivatives of \(f\) with respect to \(\theta\) evaluated at \((x^*,\theta)\) , and \(D_\theta h_{x^*,\theta}\) denotes the \(m \times k\) matrix of partial derivatives of \(f\) with respect to \(\theta\) evaluated at \((x^*,\theta)\).

Example: consumer theory

  • Consumer choosing goods \(x \in \mathbb{R}^n\) with prices \(p\) and income \(y\)
  • Value function / indirect utility function \[ v(p,y) = \max_x u(x) \text{ s.t. } p^T x - y \leq 0 \]
  • Expenditure minimization \[ e(p,\bar{u}) = \min_x p^T x \text{ s.t. } u(x) \geq \bar{u} \]
  • How do indirect utility and expenditure vary with \(p\) and \(y\)?
  • How do the maximizers for each problem vary with \(p\) and \(y\)?

Example: producer theory

  • Competitive multiple product firm facing output prices \(p \in \mathbb{R}^k\) and input prices \(w \in \mathbb{R}^n\)
  • Profits \[ \pi(p,w) = \max_{y,x} p^T y - w^T x \text{ s.t. } y - f(x) \leq 0 \]
  • Show supply slopes up and input demand slopes down, make extra assumptions about \(f\) if needed

Example: contracting with productivity shocks

  • Firm production: \(y = x f(h)\), \(f\) increasing and concave
  • Labor \(h\), productivity \(x \in \{x_H, x_L\}\)
  • Firm’s problem with \(x\) observed and contractible \[ \max_{c(x), h(x)} \sum_{i \in \{H,L\}} q_i [x_i f(h_i)-c_i] \] s.t. \[ \sum_i q_i[U(c_i) + V(1-h_i)] \geq W_0 \]
  • Show \(c_H = c_L\) and \(h_H > h_L\)

Example: contracting with productivity shocks

  • Firm’s problem with \(x\) not-contractible, observed by firm but not worker \[ \max_{c(x), h(x)} \sum_{i \in \{H,L\}} q_i [x_i f(h_i)-c_i] \] s.t. \[ \sum_i q_i[U(c_i) + V(1-h_i)] \geq W_0 \] \[ x_L f(h_L) - c_L \geq x_L f(h_H) - c_H \] \[ x_H f(h_H) - c_H \geq x_H f(h_L) - c_L \]

  • Which constraint binds?

  • Compare \(c_i\) and \(h_i\) with first-best contract