@@ -35,7 +35,8 @@ tags: [hide-output]
35353636## Overview
373738-This lecture can be viewed as an application of the {doc}`quantecon lecture <lqcontrol>`.
38+This lecture can be viewed as an application of this {doc}`quantecon lecture <lqcontrol>` about linear quadratic control
39+theory.
39404041It formulates a discounted dynamic program for a firm that
4142chooses a production schedule to balance
@@ -46,19 +47,19 @@ chooses a production schedule to balance
4647In the tradition of a classic book by Holt, Modigliani, Muth, and
4748Simon {cite}`Holt_Modigliani_Muth_Simon`, we simplify the
4849firm’s problem by formulating it as a linear quadratic discounted
49-dynamic programming problem of the type studied in this {doc}`quantecon <lqcontrol>`.
50+dynamic programming problem of the type studied in this {doc}`quantecon lecture <lqcontrol>`.
50515152Because its costs of production are increasing and quadratic in
52-production, the firm wants to smooth production across time provided
53+production, the firm holds inventories as a buffer stock in order to smooth production across time, provided
5354that holding inventories is not too costly.
545555-But the firm also prefers to sell out of existing inventories, a
56+But the firm also wants to make its sales out of existing inventories, a
5657preference that we represent by a cost that is quadratic in the
5758difference between sales in a period and the firm’s beginning of period
5859inventories.
596060-We compute examples designed to indicate how the firm optimally chooses
61-to smooth production and manage inventories while keeping inventories
61+We compute examples designed to indicate how the firm optimally
62+smooths production while keeping inventories
6263close to sales.
63646465To introduce components of the model, let
@@ -72,7 +73,7 @@ To introduce components of the model, let
7273- $d(I_t, S_t) = d_1 I_t + d_2 (S_t - I_t)^2$, where
7374 $d_1>0, d_2 >0$, be a cost-of-holding-inventories function,
7475 consisting of two components:
75-- a cost $d_1 t$ of carrying inventories, and
76+- a cost $d_1 I_t$ of carrying inventories, and
7677- a cost $d_2 (S_t - I_t)^2$ of having inventories deviate
7778 from sales
7879- $p_t = a_0 - a_1 S_t + v_t$ be an inverse demand function for a
@@ -84,7 +85,7 @@ To introduce components of the model, let
8485 be the present value of the firm’s profits at
8586 time $0$
8687- $I_{t+1} = I_t + Q_t - S_t$ be the law of motion of inventories
87-- $z_{t+1} = A_{22} z_t + C_2 \epsilon_{t+1}$ be the law
88+- $z_{t+1} = A_{22} z_t + C_2 \epsilon_{t+1}$ be a law
8889 of motion for an exogenous state vector $z_t$ that contains
8990 time $t$ information useful for predicting the demand shock
9091 $v_t$
@@ -133,17 +134,20 @@ appears in the firm’s one-period profit function)
133134We can express the firm’s profit as a function of states and controls as
134135135136$$
136-\pi_t = - (x_t' R x_t + u_t' Q u_t + 2 u_t' H x_t )
137+\pi_t = - (x_t' R x_t + u_t' Q u_t + 2 u_t' N x_t )
137138$$
138139139-To form the matrices $R, Q, H$, we note that the firm’s profits at
140+To form the matrices $R, Q, N$ in an LQ dynamic programming problem, we note that the firm’s profits at
140141time $t$ function can be expressed
141142142143$$
144+\begin{equation}
145+\begin{split}
143146\pi_{t} =&p_{t}S_{t}-c\left(Q_{t}\right)-d\left(I_{t},S_{t}\right) \\
144147 =&\left(a_{0}-a_{1}S_{t}+v_{t}\right)S_{t}-c_{1}Q_{t}-c_{2}Q_{t}^{2}-d_{1}I_{t}-d_{2}\left(S_{t}-I_{t}\right)^{2} \\
145148 =&a_{0}S_{t}-a_{1}S_{t}^{2}+Gz_{t}S_{t}-c_{1}Q_{t}-c_{2}Q_{t}^{2}-d_{1}I_{t}-d_{2}S_{t}^{2}-d_{2}I_{t}^{2}+2d_{2}S_{t}I_{t} \\
146- =&-\left(\underset{x_{t}^{\prime}Rx_{t}}{\underbrace{d_{1}I_{t}+d_{2}I_{t}^{2}}}\underset{u_{t}^{\prime}Qu_{t}}{\underbrace{+a_{1}S_{t}^{2}+d_{2}S_{t}^{2}+c_{2}Q_{t}^{2}}}\underset{2u_{t}^{\prime}Hx_{t}}{\underbrace{-a_{0}S_{t}-Gz_{t}S_{t}+c_{1}Q_{t}-2d_{2}S_{t}I_{t}}}\right) \\
149+ =&-\left(\underset{x_{t}^{\prime}Rx_{t}}{\underbrace{d_{1}I_{t}+d_{2}I_{t}^{2}}}\underset{u_{t}^{\prime}Qu_{t}}{\underbrace{+a_{1}S_{t}^{2}+d_{2}S_{t}^{2}+c_{2}Q_{t}^{2}}}
150+ \underset{2u_{t}^{\prime}N x_{t}}{\underbrace{-a_{0}S_{t}-Gz_{t}S_{t}+c_{1}Q_{t}-2d_{2}S_{t}I_{t}}}\right) \\
147151 =&-\left(\left[\begin{array}{cc}
148152I_{t} & z_{t}^{\prime}\end{array}\right]\underset{\equiv R}{\underbrace{\left[\begin{array}{cc}
149153d_{2} & \frac{d_{1}}{2}S_{c}\\
@@ -166,12 +170,14 @@ Q_{t} & S_{t}\end{array}\right]\underset{\equiv N}{\underbrace{\left[\begin{arra
166170I_{t}\\
167171z_{t}
168172\end{array}\right]\right)
173+\end{split}
174+\end{equation}
169175$$
170176171177where $S_{c}=\left[1,0\right]$.
172178173179**Remark on notation:** The notation for cross product term in the
174-QuantEcon library is $N$ instead of $H$.
180+QuantEcon library is $N$.
175181176182The firms’ optimum decision rule takes the form
177183@@ -185,6 +191,16 @@ $$
185191x_{t+1} = (A - BF ) x_t + C \epsilon_{t+1}
186192$$
187193194+The firm chooses a decision rule for $u_t$ that maximizes
195+196+$$
197+E_0 \sum_{t=0}^\infty \beta^t \pi_t
198+$$
199+200+subject to a given $x_0$.
201+202+This is a stochastic discounted LQ dynamic program.
203+188204Here is code for computing an optimal decision rule and for analyzing
189205its consequences.
190206@@ -330,7 +346,7 @@ class SmoothingExample:
330346Notice that the above code sets parameters at the following default
331347values
332348333-- discount factor β=0.96,
349+- discount factor $\beta=0.96$,
334350- inverse demand function: $a0=10, a1=1$
335351- cost of production $c1=1, c2=1$
336352- costs of holding inventories $d1=1, d2=1$
@@ -465,7 +481,7 @@ We introduce this $I_t$ **is hardwired to zero** specification in
465481order to shed light on the role that inventories play by comparing outcomes
466482with those under our two other versions of the problem.
467483468-The bottom right panel displays an production path for the original
484+The bottom right panel displays a production path for the original
469485problem that we are interested in (the blue line) as well with an
470486optimal production path for the model in which inventories are not
471487useful (the green path) and also for the model in which, although