Abstract
Numerical dynamic programming algorithms typically use Lagrange data to approximate value functions over continuous states. Hermite data can be easily obtained from solving the Bellman equation and used to approximate the value functions. We illustrate the use of Hermite data with one-, three-, and six-dimensional examples. We find that Hermite approximation improves the accuracy in value function iteration (VFI) by one to three digits using little extra computing time. Moreover, VFI with Hermite approximation is significantly faster than VFI with Lagrange approximation for the same accuracy, and this advantage increases with the dimension of the continuous states.
Similar content being viewed by others
Notes
Examples include optimal growth problems (e.g., Trick and Zin 1997; Judd 1998; Den Haan et al. 2011), life-cycle consumption problems (e.g., Cocco et al. 2005), dynamic portfolio problems (e.g., Gupta and Murray 2005; Infanger 2006; Cai et al. 2013), dynamic resource allocation problems (e.g., Powell and Van Roy 2004), and optimal carbon tax problems (e.g., Cai et al. 2013a). See Judd (1998), Bertsekas (2005, 2007), Powell (2007), Rust (2008), and Cai and Judd (2014) for more examples.
H-VFI can also be more efficient than L-VFI in solving other kinds of DP problems with differential value functions over continuous state variables, such as life-cycle consumption problems (e.g., Cocco et al. 2005), dynamic resource allocation problems (e.g., Powell and Van Roy 2004), and optimal carbon tax problems (e.g., Cai et al. 2013a).
Rust (1997) and Rust et al. (2002) prove that the curse of dimensionality exists for dynamic programming problems in the worst-case analysis. However, Griebel and Wozniakowski (2006) show that there is no curse of dimensionality in approximating functions having sufficient smoothness, while many DP problems in economics have smooth value functions which can be approximated well by the complete polynomial approximation method.
It is standard for a solver to report the multipliers associated with a solution of a constrained optimization problem. For example, in fmincon, the solver in the Matlab Optimization Toolbox, the command
$$\begin{aligned}{}[\hbox {X,FVAL,EXITFLAG,OUTPUT,LAMBDA}] = \hbox {fmincon}(\hbox {FUN},\hbox {X0},\ldots ) \end{aligned}$$prompts the solver to report the multipliers in the vector LAMBDA. Similar commands are provides by other solvers, such as KNITRO (Byrd et al. 2006), CONOPT (Drud 1996), SNOPT (Gill et al. 2005), MINOS (Murtagh and Saunders 2003), and so on. Moreover, these solvers are available in the NEOS server (Czyzyk et al. 1998; Gropp and Moré 1997) by uploading code in AMPL (Fourer et al. 1990, 2003) or GAMS (Bisschop and Meeraus 1982; Brooke et al. 1997; McCarl 2011) with the NEOS graphical user interface (http://www.neos-server.org/neos/) or a callable interface (Dolan et al. 2008).
The objective in (8) is an unweighted sum of squared errors. Weighted versions of the least squares may do better but we do not pursue that possibility in this paper.
This can be proved recursively.
This is a special case of the model (1) with \(u_{t}\equiv 0\) for \(t<T\) and \(\beta =1\) (the value of \(\beta \) does not matter if it is positive).
We provide a MATLAB subroutine in https://sites.google.com/site/dphermite/boundednormal to compute \(\kappa \) for any given \(\Upsilon >0\).
All the examples are run on a 2.5 GHz Intel core.
We omit some cases of \(m=20\) or 40 for H-VFI to make it clearer in comparison between L-VFI and H-VFI. Moreover, for economics problems, usually the accuracy \(O(10^{-6})\) is enough.
All the examples in this paper are run on a 2.5 GHz Intel core of a laptop.
The ranges of \(\beta \), \(\gamma \), and \(\eta \) have already covered the most of values in the economics literature for the optimal growth problems.
We omit the cases of H-VFI with \(m=10\) because H-VFI with \(m=7\) has produced solutions with the accuracy at \(O(10^{-6})\).
We omit the case of H-VFI with \(d=5\) and \(m=7\), because it will be too time-consuming to run the GAMS code using a laptop. But for the five-country problem, H-VFI with \(m=5\) achieves \(O(10^{-4})\) accuracy, which is one-digit more accurate and also faster than L-VFI with \(m=7\).
All the running times can be dramatically reduced if we use Fortran code and the NPSOL solver (Gill et al. 1994), but the relative difference between H-VFI and L-VFI is still almost the same.
References
Aldrich EM, Fernandez-Villaverde J, Gallant AR, Rubio- Ramrez JF (2011) Tapping the supercomputer under your desk: solving dynamic equilibrium models with graphics processors. J Econ Dyn Control 35:386–393
Bellman R (1957) Dynamic programming. Princeton University Press, Princeton
Bertsekas D (2005) Dynamic programming and optimal control, vol 1. Athena Scientific, Belmont
Bertsekas D (2007) Dynamic programming and optimal control, vol 2. Athena Scientific, Belmont
Bisschop JJ, Meeraus A (1982) On the development of a general algebraic modeling system in a strategic planning environment. Math Program Stud 20:1–29
Brooke A, Kendrick D, Meeraus A, Raman R (1997) GAMS language guide. Technical report, GAMS Development Corporation
Byrd RH, Nocedal J, Waltz RA (2006) KNITRO: an integrated package for nonlinear optimization. http://www.ziena.com/papers/integratedpackage. Technical report, Ziena
Cai Y (2010) Dynamic programming and its application in economics and finance. PhD thesis, Stanford University
Cai Y, Judd KL (2012) Dynamic programming with shape-preserving rational spline Hermite interpolation. Econ Lett 117(1):161–164
Cai Y, Judd KL (2013) Shape-preserving dynamic programming. Math Methods Oper Res 77(3):407–421
Cai Y, Judd KL (2014) Advances in numerical dynamic programming and new applications. Chapter 8. In: Schmedders Karl, Judd Kenneth L (eds) Handbook of computational economics, vol 3. Elsevier, Amsterdam
Cai Y, Judd KL, Lontzek TS (2013) The social cost of stochastic and irreversible climate change. NBER working paper 18704
Cai Y, Judd KL, Xu R (2013) Numerical solution of dynamic portfolio optimization with transaction costs. NBER working paper No. 18709
Cai Y, Judd KL, Thain G, Wright S (2015) Solving dynamic programming problems on computational grid. Comput Econ 45(2):261–284
Cocco JF, Gomes FJ, Maenhout PJ (2005) Consumption and portfolio choice over the life cycle. Rev Financ Stud 18(2):491–533
Czyzyk J, Mesnier MP, Moré JJ (1998) The NEOS server. IEEE Comput Sci Eng 5:68–75
Den Haan WJ, Judd KL, Juillard M (2011) Computational suite of models with heterogeneous agents II:multi-country real business cycle models. J Econ Dyn Control 35:175–177
Dolan ED, Fourer R, Goux JP, Munson TS, Sarich J (2008) Kestrel: an interface from optimization modeling systems to the NEOS server. INFORMS J Comput 20(4):525–538
Drud AS (1996) CONOPT: a system for large scale nonlinear optimization. ARKI Consulting and Development A/S, Bagsvaerd
Fourer R, Gay DM, Kernighan BW (1990) A modeling language for mathematical programming. Manag Sci 36:519–554
Fourer R, Gay DM, Kernighan BW (2003) AMPL: a modeling language for mathematical programming, 2nd edn. Duxbury Press, Pacific Grove
Gill P, Murray W, Saunders MA, Wright MH (1994) User’s Guide for NPSOL 5.0: a Fortran Package for Nonlinear Programming. Technical report, SOL, Stanford University
Gill P, Murray W, Saunders MA (2005) SNOPT: an SQP algorithm for largescale constrained optimization. SIAM Rev 47(1):99–131
Griebel M, Wozniakowski H (2006) On the optimal convergence rate of universal and nonuniversal algorithms for multivariate integration and approximation. Math Comput 75(255):1259–1286
Gropp W, Moré JJ (1997) Optimization environments and the NEOS server. In: Buhmann MD, Iserles A (eds) Approximation theory and optimization: tributes to M. J. D. Powell. Cambridge University Press, Cambridge, UK, pp 167–182
Gupta A, Murray W (2005) A framework algorithm to compute optimal asset allocation for retirement with behavioral utilities. Comput Optim Appl 32(1/2):91–113
Infanger G (2006) Dynamic asset allocation strategies using a stochastic dynamic programming approach. Chapter 5. In: Zenios SA, Ziemba WT (Eds) Handbook of asset and liability management, volume 1, North Holland
Judd KL (1998) Numerical methods in economics. The MIT Press, Cambridge
Judd KL, Maliar L, Maliar S (2011) Numerically stable and accurate stochastic simulation approaches for solving dynamic economic models. Quant Econ 2:173–210
Juillard M, Villemot S (2011) Multi-country real business cycle models: accuracy tests and test bench. J Econ Dyn Control 35:178–185
Malin BA, Krueger D, Kubler F (2011) Solving the multi-country real business cycle model using a Smolyak-collocation method. J Econ Dyn Control 35:229–239
McCarl B, et al. (2011) McCarl expanded GAMS user guide, version 23.6. http://www.gams.com/mccarl/mccarlhtml/. Accessed 06 Sept 2012
Murtagh BA, Saunders MA (2003) MINOS 5.51 User’s Guide. http://www.stanford.edu/group/SOL/guides/minos551. Technical report, SOL, Stanford University
Philbrick CR, Kitanidis PK (2001) Improved dynamic programming methods for optimal control of lumped parameter stochastic systems. Oper Res 49(3):398–412
Powell WB (2007) Approximate dynamic programming: solving the curses of dimensionality. Wiley Interscience, Hoboken
Powell WB, Van Roy B (2004) Approximate dynamic programming for high-dimensional dynamic resource allocation problems. Chapter 10. In: Si J, Barto AG, Powell W, Wunsch D (Eds) Handbook of learning and approximate dynamic programming. Wiley-IEEE Press, Hoboken, NJ
Rivlin TJ (1990) Chebyshev polynomials: from approximation theory to algebra and number theory. Wiley Interscience, New York
Rust J (1997) Using randomization to break the curse of dimensionality. Econometrica 65(3):487–516
Rust J (2008) Dynamic programming. In: Durlauf Steven N, Blume Lawrence E (eds) New palgrave dictionary of economics, 2nd edn. Palgrave Macmillan, Basingstoke
Rust J, Traub JF, Wozniakowski H (2002) Is there a curse of dimensionality for contraction fixed points in the worst case? Econometrica 70(1):285–329
Schumaker L (1983) On shape-preserving quadratic spline interpolation. SIAM J Numer Anal 20:854–864
Trick MA, Zin SE (1997) Spline approximations to value functions–linear programming approach. Macroecon Dyn 1:255–277
Wang SP, Judd KL (2000) Solving a savings allocation problem by numerical dynamic programming with shape-preserving interpolation. Comput Oper Res 27(5):399–408
Author information
Authors and Affiliations
Corresponding author
Additional information
We are grateful to the editor, an associate editor, and two anonymous referees for their helpful comments. We also thank Jesus Fernandez-Villaverde, Thomas Lontzek, and Jevgenijs Steinbuks for their comments. Cai gratefully acknowledges NSF support (SES-0951576). An earlier version of this paper is “Dynamic Programming with Hermite Interpolation” (RDCEP Working Paper 12-09).
Appendices
Appendix 1: One-dimensional Chebyshev polynomial approximation
One-dimensional Chebyshev basis polynomials on \([-1,1]\) are defined as \(\mathcal {T}_{j}(x)=\cos (j\cos ^{-1}(x)),\) while general Chebyshev polynomials on \([x_{\min },x_{\max }]\) are defined as \(\mathcal {T}_{j}\left( Z(x)\right) \) where
for \(j=0,1,2,\ldots \). These polynomials are orthogonal under the weighted inner product: \(\left<f,g\right>=\int _{x_{\min }}^{x_{\max }}f(x)g(x)w(x)dx\) with the weighting function \(w(x)=\left( 1-\left( Z(x)\right) ^{2}\right) ^{-1/2}\). The degree \(n\) Chebyshev polynomial approximation for \(V(x)\) on \([x_{\min },x_{\max }]\) is
where \(\mathbf{b}=\left\{ b_{j}\right\} \) are the Chebyshev coefficients.
If we choose the Chebyshev nodes on \([x_{\min },x_{\max }]\): \(x_{i}=(z_{i}+1)(x_{\max }-x_{\min })/2+x_{\min }\) with \(z_{i}=-\cos \left( (2i-1)\pi /(2m)\right) \) for \(i=1,\ldots ,m\), and Lagrange data \(\{(x_{i},v_{i}):\) \(i=1,\ldots ,m\}\) are given (where \(v_{i}=V(x_{i})\)), then the coefficients \(\left\{ b_{j}\right\} \) in (15) can be easily computed by the following formula:
The method is called the Chebyshev regression algorithm in Judd (1998).
When the number of the Chebyshev nodes is equal to the number of the Chebyshev coefficients (i.e., \(m=n+1\)), the approximation (15) with the coefficients given by (16) becomes the Chebyshev polynomial interpolation (which is a Lagrange interpolation), as \(\hat{V}(x_{i};\mathbf{b})=v_{i}\), for \(i=1,\ldots ,m\).
It is often more stable to use the expanded Chebyshev polynomial interpolation (Cai et al. 2010), as the above standard Chebyshev polynomial interpolation gives poor approximation in the neighborhood of the end points of the approximation interval. That is, we use the following formula to approximate \(V(x)\):
where \(\widetilde{x}_{\min }=x_{\min }-\delta \) and \(\widetilde{x}_{\max }=x_{\max }+\delta \) with \(\delta =(z_{1}+1)(x_{\min }-x_{\max })/(2z_{1})\). Moreover, if we choose the expanded Chebyshev nodes on \([x_{\min },x_{\max }]\): \(x_{i}=(z_{i}+1)(\tilde{x}_{\max }-\tilde{x}_{\min })/2+\tilde{x}_{\min }\), then the coefficients \(\left\{ b_{j}\right\} \) can also be calculated easily by the expanded Chebyshev regression algorithm (Cai et al. 2010), which is similar to (16).
Appendix 2: Multidimensional complete Chebyshev polynomial approximation
In a \(d\)-dimensional approximation problem, let the approximation domain of the value function be
for some real numbers \(x_{\min ,j}\) and \(x_{\max ,j}\) with \(x_{\max ,j}>x_{\min ,j}\) for \(j=1,\ldots ,d\). Let \(\mathbf {x}_{\min }=(x_{\min ,1},\ldots ,x_{\min ,d})\) and \(\mathbf {x}_{\max }=(x_{\max ,1},\ldots ,x_{\max ,d})\). Then we denote \([\mathbf {x}_{\min },\mathbf {x}_{\max }]\) as the approximation domain. Let \(\alpha =(\alpha _{1},\ldots ,\alpha _{d})\) be a vector of nonnegative integers. Let \(\mathcal {T}_{\alpha }(\mathbf {z})\) denote the product \(\prod _{1\le j\le d}\mathcal {T}_{\alpha _{j}}(z_{j})\) for \(\mathbf {z}=(z_{1},\ldots ,z_{d})\in [-1,1]^{d}\). Let
for any \(\mathbf {x}=(x_{1},\ldots ,x_{d})\in [\mathbf {x}_{\min },\mathbf {x}_{\max }]\).
Using these notations, the degree \(n\) complete Chebyshev approximation for \(V(\mathbf {x})\) is
where \(|\alpha |=\sum _{j=1}^{d}\alpha _{j}\). The number of terms with \(0\le |\alpha |=\sum _{j=1}^{d}\alpha _{i}\le n\) is \(\left( {\begin{array}{c}n+d\\ d\end{array}}\right) \) for the degree \(n\) complete Chebyshev approximation in \({\mathbb {R}}^{d}\).
Appendix 3: Multivariate numerical integration
From the formula (11), we know that \(V_{t+1}(R_{f}B+\mathbf {R}^{\top }\mathbf {S})\) in the objective function of (9) can be rewritten as \(G(\varsigma )\) for some function \(G\) where \(\varsigma \) is the \(D\)-dimensional vector of the corresponding standard normal random variables with a correlation matrix \(\Sigma \). Since \(\Sigma \) must be a positive semi-definite matrix from the covariance property, we can have its Cholesky factorization, \(\Sigma =LL^{\top }\), where \(L\) is a \(D\times D\) lower triangular matrix. Therefore,
where \(\{w_{i}:\,1\le i\le K\}\) and \(\{q_{i}:\,1\le i\le K\}\) are the Gauss-Hermite quadrature weights and nodes over \((-\infty ,\infty )\), \(L_{i,j}\) is the \((i,j)\)-element of \(L\), and \(\det (\cdot )\) means the matrix determinant operator.
Appendix 4: Tree method
Assume that \(\theta _{t}\) is a Markov chain with possible states, \(\vartheta _{1},\ldots ,\vartheta _{M}\), and the probability of going from state \(\vartheta _{i}\) to state \(\vartheta _{j}\) in one step is
Thus, from time 0 to time \(t\), there are \(M^{t}\) paths of \(\theta _{t}\) for a given initial state, for \(0\le t\le T\). These paths comprise a tree structure. We can then compute the exact solutions of the dynamic stochastic problems with the tree structure by applying an optimization solver to solve a large-scale optimal control problem directly, called the tree method here.
In the tree method for the stochastic optimal growth problem (14), the goal is to find the optimal decisions \(\left\{ \left( \mathbf {I}_{t,i},\mathbf {c}_{t,i},\varvec{\ell }_{t,i}\right) :\,1\le i\le M^{t},\,0\le t<T\right\} \) to maximize the expected total utility:
subject to the corresponding constraints of (14) for all paths, where \(\hbox {mod}(i-1,M)\) is the remainder of division of \((i-1)\) by \(M\), \(P_{t,i}\) is the probability of the \(i\)-th path from time 0 to time \(t\) with the following recursive formula:
for \(j=1,\ldots ,M\), \(i=1,\ldots ,M^{t}\), \(t=1,\ldots ,T-2\), where \(P_{0,1}=1\) and \(P_{1,j}={\mathbb {P}}(\theta _{1}=\vartheta _{j}\,|\,\theta _{0})\) for a given \(\theta _{0}\).
This approach is practical for only small values of \(M\) and \(T\). In our examples, we set \(M=2\) and \(T=5\), implying that there are only 32 possible paths, and nonlinear optimization solvers will produce results with as much precision as possible in a double precision environment. We will treat those solutions as the “true” solution which can be used for the error analysis of numerical DP algorithms.
Rights and permissions
About this article
Cite this article
Cai, Y., Judd, K.L. Dynamic programming with Hermite approximation. Math Meth Oper Res 81, 245–267 (2015). https://doi.org/10.1007/s00186-015-0495-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00186-015-0495-z
Keywords
- Dynamic programming
- Value function iteration
- Hermite approximation
- Dynamic portfolio optimization
- Multi-country optimal growth model