Skip to main content

11  Optimization with Discrete Choices

This section studies discrete optimization problems.

11.1 Discrete optimization

11.1.1 Integer programming problem

An integer programming problem is a type of optimization problem where some or all of the variables are required to take on integer values. This is particularly useful in scenarios where the decision variables represent discrete choices, such as the number of items to produce, the number of workers to assign, or the number of vehicles to dispatch.

11.1.2 Labor choices for firms

Suppose we have a firm’s profit maximization problem with a CES production function, where the firm chooses the number of college educated and non-college educated workers to maximize profit. The firm’s profit function can be expressed as:

\[ \pi = p \cdot f(L_c, L_n) - w_c \cdot L_c - w_n \cdot L_n \]

where:

  • \(\pi\) is the profit,
  • \(p\) is the price of the output,
  • \(f(L_c, L_n)\) is the production function,
  • \(L_c\) is the number of college educated workers,
  • \(L_n\) is the number of non-college educated workers,
  • \(w_c\) is the wage for college educated workers, and
  • \(w_n\) is the wage for non-college educated workers.

The production function \(f\) is a constant elasticity of substitution (CES) function, which can be expressed as:

\[ f(L_c, L_n) = A \left( \alpha L_c^{\rho} + (1 - \alpha) L_n^{\rho} \right)^{\frac{\phi}{\rho}} \]

where:

  • \(A\) is a scaling factor, the total factor productivity,
  • \(\alpha\) is the “share” parameter that helps to capture the relative productivity of college educated workers,
  • \(\rho\) is the substitution parameter, the elasticity of substitution between the two types of labor is given by \(\sigma = \frac{1}{1 - \rho}\), which means that \(\rho\) is equal to \(\frac{\sigma -1 }{\sigma}\).
  • \(\phi\) is a parameter that determines the overall returns to scale.

In dealing with large firms and economic aggregates, generally we think about \(L_c\) and \(L_n\) as continuous variables. But suppose we are analyzing the choices of small firms, and there are policies that are based on specific firm size thresholds (e.g., registration thresholds, insurance thresholds, etc.). In this case, we may want to restrict the choices of \(L_c\) and \(L_n\) to be integers, to study how policies impact firms.

The discrete choice profit maximization problem can be formulated as follows:

\[\begin{align} \max_{L_c, L_n} & \quad p \cdot f(L_c, L_n) - w_c \cdot L_c - w_n \cdot L_n \\ \text{subject to} & \quad L_c, L_n \in \mathbb{Z}^+ \\ \end{align}\]

where \(\mathbb{Z}^+\) denotes the set of positive integers.

How do we solve for this problem? We can explore all possible combinations of positive integers. We could also explore properties of the production function and the cost function.

First, solve the problem holding \(Lc + Ln = L\) constant, and only vary \(L_c\). Specifically, we can rewrite the profit function as:

\[ \pi = p \cdot f(L_c, L - L_c) - w_c \cdot L_c - w_n \cdot (L - L_c) \]

The integer programming problem is is over just the \(L_c\) choices:

\[\begin{align} \pi^{\ast}\left(L\right) = \max_{L_c} & \quad p \cdot f(L_c, L - L_c) - w_c \cdot L_c - w_n \cdot (L - L_c) \\ \text{subject to} & \quad L_c \in \mathbb{Z}^+ \text{ and } L_c \le L \\ \end{align}\]

If \(\phi<1\), the set \(\left\{\pi^{\ast}\left(L\right) \mid L \in \mathbb{Z}, L \ge 2 \right\}\) has a single peak point. So we incrementally solve at higher \(L\) until the optimal profit begins to decrease.

11.1.3 The number of optimal withdraws

Given a constant consumption function over time \(c(t)=c\), we make a decision about how many times to withdraw cash from the bank to support this consumption flow. Keeping money at the bank earns interest (that infinitely compounds) given interest rate \(r\), and each withdraw has a fixed cost \(\psi\). Withdrawing more frequently generates higher interests earnings, but incurs more fixed costs of withdraw.

During time period \(t=0\) to \(t=1\), what is the optimal number of withdraws?

We want to use the cost minimization problem where by choosing the number of withdraws, we minimize the amount of resources needed at \(t=0\) to support consumption flow between time \(t=0\) and time \(t=1\).

Let the cost function be \(COST(r, \psi, c, n)\), where \(n\) is the number of withdraws. The cost minimization problem is:

\[\begin{align} \min_{n} & \quad COST(r, \psi, c, n) \\ \text{subject to} & \quad n \in \mathbb{Z}^+ \end{align}\]

Suppose we only withdraw at the start once, then in terms of present value at time \(t=0\), we need to have:

\[\begin{align} COST(r, \psi, c, n=1) = \psi + c \end{align}\]

If we withdraw twice, or three times, for future withdraws, if \(r>0\), we do need less money then what will be withdrawn (along with fixed cost) at time \(t=0\). Furthermore, when we withdraw more frequently, the amount of withdraw is divided by the number of withdraws, although the fixed cost of withdraw is incurred for each withdraw.

\[\begin{align} COST(r, \psi, c, n=2) &= \left(\psi + \frac{c}{2}\right) + \left(\psi + \frac{c}{2}\right) e^{-\frac{r}{2}} \\ COST(r, \psi, c, n=3) &= \left(\psi + \frac{c}{3}\right) + \left(\psi + \frac{c}{3}\right) e^{-\frac{r}{3}} + \left(\psi + \frac{c}{3}\right) e^{-\frac{2r}{3}}\\ \end{align}\]

How do we solve this problem? We can solve continue this cost function calculation and compare among all alternatives \(n\) values to find the one that provides the lowest cost.

This is cumbersome. The problem actually has an analytical solution. Consider the COST functions above as a linear function of \(c\). Note that as \(n\) increase (at decreasing rate), the y-intercept increases, and the slope decreases (but remains positive), if \(r>0\). Drawing a figure where the x-axis is \(c\) and the y-axis is \(COST(r, \psi, c, n)\), we can form the lower envelope of all the intersecting lines. Solving for consecutive intersections of lines between \(n\) and \(n+1\) provides the thresholds where the optimal number of withdraws switches from making \(n\) to making \(n+1\) withdraws.

We have shown that a continuous time problem with discrete choice can have analytical solutions.

11.1.4 The number of optimal withdraws and optimal initial deposit, joint continuous and discrete optimization

We modify the prior problem in the following way:

  • At the start of the period, you earn income \(W\), this income is eared as cash-in-pocket
  • We choose how much of the cash-in-pocket to deposit into the bank, \(\alpha W\), where \(\alpha \in \left[0, 1\right]\).

Between time \(t=0\) and \(t=\widehat{t}\), consumption flow is supported by initial cash-in-pocket that was not deposited, the \((1-\alpha) W\) units of cash. Between \(t=\widehat{t}\) to \(T\), consumption is supported by withdraws from the bank.

The individuals chooses \(\widehat{t}\) (there is a one-to-one mapping between chooseing \(\widehat{t}\) and \(\alpha\)) and chooses \(N\), the number of withdraws to make between \(widehat{t}\) and \(T\).

Now we have a joint continuous and discrete choice problem. The overall optimization problem is:

\[\begin{align} \begin{gathered} \max_{N \in \mathbb{N}, \widehat{t} \in [0, T]} C\\ \text{s.t.}\, w = \Lambda^{depositwithdraw}\left(\widehat{t}, N \mathrel{;} C\right) + \Lambda^{initpocket}\left(\widehat{t} \mathrel{;} C\right) \end{gathered} \end{align}\]

\(\Lambda^{depositwithdraw}\left(\widehat{t}, N \mathrel{;} C\right)\) is resources needed at \(t=0\) to support all the \(N\) withdraws from \(t=\widehat{t}\) to \(T\). \(\Lambda^{initpocket}\left(\widehat{t} \mathrel{;} C\right)\) is resources needed at \(t=0\) to support consumption from the initial cash-in-pocket until \(t=\widehat{t}\). These two functions are constructed following our discussion in the last section.

We can further divide the problem to solve for the optimal \(N\) given \(\widehat{t}\) by minimizing the \(\Lambda^{depositwithdraw}\left(\widehat{t}, N \mathrel{;} C\right)\) with respect to \(N\). Specifically, we solve:

\[ \min_{N \in \mathbb{N}} \Lambda^{depositwithdraw}\left(\widehat{t}, N \mathrel{;} C\right) \]

Once the optimal \(N^{\ast}\left(C, \widehat{t}\right)\) is determined as a function of \(\widehat{t}\), we can then optimize over \(\widehat{t}\) to find the overall optimal solution that maximizes \(C\), given the solution found from minimization earlier:

\[\begin{align} \begin{gathered} \max_{\widehat{t} \in [0, T]} C\\ \text{s.t.}\, w = \Lambda^{depositwithdraw}\left(\widehat{t}, N^{\ast}\left(C, \widehat{t}\right) \mathrel{;} C\right) + \Lambda^{initpocket}\left(\widehat{t} \mathrel{;} C\right) \end{gathered} \end{align}\]

11.2 Choosing among discrete categories

11.2.1 Multinomial logit

Multinomial logit is a model used to predict the probabilities of different outcomes in a situation where there are multiple discrete choices. It is particularly useful when the choices are mutually exclusive and exhaustive.

Suppose we have 3 alternatives:\(A\), \(B\), and \(C\). The utility for each alternative can be expressed as:

\[ U_A = \beta_{A0} + \beta_{A1} X_1 + \beta_{A2} X_2 + \ldots + \beta_{An} X_n + \epsilon_A \]

\[ U_B = \beta_{B0} + \beta_{B1} X_1 + \beta_{B2} X_2 + \ldots + \beta_{Bn} X_n + \epsilon_B \]

\[ U_C = \beta_{C0} + \beta_{C1} X_1 + \beta_{C2} X_2 + \ldots + \beta_{Cn} X_n + \epsilon_C \]

where \(U_A\), \(U_B\), and \(U_C\) are utilities for alternatives \(A\), \(B\), and \(C\); \(X_1,\ldots,X_n\) are observed characteristics; and the \(\beta\) terms are parameters. The \(\epsilon_j\) terms are unobserved utility components.

Write the systematic (observed) part of utility as \(V_j = \beta_{j0} + \beta_{j1} X_1 + \ldots + \beta_{jn} X_n\), so that \(U_j = V_j + \epsilon_j\) for \(j \in \{A,B,C\}\).

We can not pin down utility itself, but can look at the difference in utilities, comparing the utility of A versus B and A versus C, we have, differencing their respective utility functions:

\[ U_A - U_B = (V_A - V_B) + (\epsilon_A - \epsilon_B) \]

\[ U_A - U_C = (V_A - V_C) + (\epsilon_A - \epsilon_C) \]

Assume that the error terms are independent and identically distributed Type I extreme-value (Gumbel) variables, with their scale normalized to one. Then the closed-form choice probabilities depend on the systematic utilities \(V_j\) only:

\[ P(A \text{ chosen}) = \frac{e^{V_A}}{e^{V_A} + e^{V_B} + e^{V_C}} \]

\[ P(A \text{ chosen}) = \frac{e^{\beta_{A0} + \beta_{A1} X_1 + \beta_{A2} X_2 + \ldots + \beta_{An} X_n}}{\sum_{j \in \{A, B, C\}} e^{\beta_{j0} + \beta_{j1} X_1 + \beta_{j2} X_2 + \ldots + \beta_{jn} X_n}} \]

Equivalently, using differences in systematic utilities:

\[ P(A \text{ chosen}) = \frac{e^{V_A - V_B}}{1 + e^{V_A - V_B} + e^{V_C - V_B}} \]

The differences in systematic utility are linear in the coefficient differences:

\[ V_j-V_k=(\beta_{j0}-\beta_{k0})+\sum_{m=1}^{n}(\beta_{jm}-\beta_{km})X_m. \]

Only utility differences are identified; one alternative’s coefficients are commonly normalized to zero. Given the model-implied choice probabilities, the log ratio for categories \(A\) and \(B\) is linear in the coefficient differences:

\[ \log\left(\frac{P(A \text{ chosen})}{P(B \text{ chosen})}\right) = (\beta_{A0} - \beta_{B0}) + (\beta_{A1} - \beta_{B1}) X_1 + (\beta_{A2} - \beta_{B2}) X_2 + \ldots + (\beta_{An} - \beta_{Bn}) X_n \]

The left-hand-side is the log odds ratio. Although this equation is linear in the \(\beta\) differences, individual discrete choices are not estimated by ordinary least squares on 0/1 outcomes. Instead, estimate the \(\beta\) parameters by maximum likelihood for the multinomial logit model (a discrete-choice MLE routine).