# A Genetic Algorithm for Investment–Consumption Optimization with Value-at-Risk Constraint and Information-Processing Cost

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Formulation

- Generate an initial population and evaluate the fitness of the individuals in the population;
- Select parents from the population;
- Crossover (mate) parents to produce children and evaluate the fitness of the children;
- Replace some or all of the population by the children until a satisfactory solution is found.

## 3. Numerical Simulation with Genetic Algorithm

#### 3.1. Numerical Example

#### 3.2. Implementation of GA

- Step 1:
- Set parameters ${P}_{c}=0.2$ (probability of crossover), ${P}_{m}=0.1$ (probability of mutation), $N=30$ (size of population), $b=0.05$ (the parameter used in the evaluation); set iteration $iter:=0$, $best:=0$.
- Step 2:
- Initialize population $pop(iter)=\{{\theta}_{1},\dots ,{\theta}_{N}\}$, which is a population that contains N solutions. In our context, ${\theta}_{i}=({\eta}_{1},\dots ,{\eta}_{120},{\pi}_{1},\dots ,{\pi}_{120},{\alpha}_{1},\dots ,{\alpha}_{120})$, ${\eta}_{j}$, ${\pi}_{j}$, and ${\alpha}_{j}$ ($j=1,\dots ,120$) are three random controls following a uniform distribution $U(0,1)$. Note that our time window is 60 years and the step size is 1/2; thus, each control variable can be discretized from $j=1$ up to $j=120$.
- Step 3:
- Evaluate $pop(iter):\phantom{\rule{0.166667em}{0ex}}\{{\theta}_{1},\dots ,{\theta}_{N}\}$:
- 3-1:
- 3-2:
- Descending sort $\{J({\theta}_{1}),\dots ,J({\theta}_{N})\}$; for the sake of brevity, we assume $J({\theta}_{1})\ge J({\theta}_{2})\ge \cdots \ge J({\theta}_{N})$. If $best<J({\theta}_{1})$, then denote the best value as $best=J({\theta}_{1})$ and store ${\theta}_{1}$.
- 3-3:
- If the stop criterion $iter=1000$ is satisfied, output ${\theta}_{1}$ and the best value $best$ and stop the genetic algorithm. Otherwise, continue the algorithm.
- 3-4:
- Evaluate each ${\theta}_{i}$ by$$eval({\theta}_{i})=b{(1-b)}^{i-1}.$$

- Step 4:
- Selection:
**For**$i:=1$**to**N- 4-1:
- For each ${\theta}_{i}$, calculate the cumulative probability ${q}_{i}$$$\left\{\begin{array}{c}{q}_{0}=0,\hfill \\ {q}_{i}={\displaystyle \sum _{j=1}^{i}}eval({\theta}_{j})\phantom{\rule{1.em}{0ex}}i=1,2,\dots ,N\hfill \end{array}\right.$$
- 4-2:
- Generate a random number $r\sim U(0,{q}_{N})$;
- 4-3:
- If ${q}_{i-1}<r\le {q}_{i}$, then choose the ith individual ${\theta}_{i}$, and let ${\theta}_{i}^{\prime}\leftarrow {\theta}_{i}$;
**End For**(Here, we can obtain N individuals ${\theta}_{1}^{\prime},\dots ,{\theta}_{N}^{\prime}$).

- Step 5:
- Crossover:
**For**$i:=1$**to**N- 5-1:
- Generate a random number $r\sim U(0,1)$;
- 5-2:
- Choose ${\theta}_{i}^{\prime}$ as a parent if $r<{P}_{c}$, and let ${V}_{i}\leftarrow {\theta}_{i}^{\prime}$;
**End For**(Here, we can obtain k ($k\le N$) parents ${V}_{1},\dots ,{V}_{k}$).- 5-3:
- Partition $\{{V}_{1},\dots ,{V}_{k}\}$ into $k/2$ pairs randomly $({V}_{1},{V}_{2}),({V}_{3},{V}_{4}),\dots $ (if k is odd, we can discard an arbitrary one).
- 5-4:
- Generate another random number $d\sim U(0,1)$; for each pair $({V}_{i},{V}_{i+1})$, we can get two new individuals by$$\begin{array}{c}X=d{V}_{i}+(1-d){V}_{i+1}\hfill \\ Y=(1-d){V}_{i}+d{V}_{i+1}\hfill \\ {V}_{i}\leftarrow X\hfill \\ {V}_{i+1}\leftarrow Y\hfill \end{array}$$
- 5-5:
- Use $\{{V}_{1},\dots ,{V}_{k}\}$ to replace k individuals in $\{{\theta}_{1}^{\prime},\dots ,{\theta}_{N}^{\prime}\}$.

- Step 6:
- Mutation:
**For**$i:=1$**to**N- 6-1:
- Generate a random number $r\sim U(0,1)$;
- 6-2:
- If $r<{P}_{m}$, generate an individual ${V}_{i}^{\prime}=({\eta}_{1},\dots ,{\eta}_{120},{\pi}_{1},\dots ,{\pi}_{120},{\alpha}_{1},\dots ,{\alpha}_{120})$ and let ${\theta}_{i}^{\prime}\leftarrow {V}_{i}^{\prime}$; ${\eta}_{j}$, ${\pi}_{j}$, and ${\alpha}_{j}$ are three random controls following a uniform distribution $U(0,1)$. Then, let ${\theta}_{i}^{\prime}\leftarrow {V}_{i}^{\prime}$;
**End For**

- Step 7:
- Now, a new population $\{{\theta}_{1}^{\prime},\dots ,{\theta}_{N}^{\prime}\}$ is obtained. Let ${\theta}_{i}\leftarrow {\theta}_{i}^{\prime}$, $iter\leftarrow iter+1$, and go to Step 3.

**Remark**

**1.**

## 4. Concluding Remarks

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Abel, Andrew B. 1990. Asset prices under habit formation and catching up with the joneses. The American Economic Review 80: 38–42. [Google Scholar]
- Abel, Andrew B., Janice C. Eberly, and Stavros Panageas. 2013. Optimal inattention to the stock market with information costs and transactions costs. Econometrica 81: 1455–81. [Google Scholar]
- Andrei, Daniel, and Michael Hasler. 2017. Dynamic Attention Behavior Under Return Predictability. Working Paper. Available online: http://www-2.rotman.utoronto.ca/facbios/file/AH3_20170429.pdf (accessed on 22 January 2019).
- Bengen, William P. 1994. Determining withdrawal rates using historical data. Journal of Financial Planning 1: 14–24. [Google Scholar]
- Brennan, Michael J., and Yihong Xia. 2002. Dynamic asset allocation under inflation. The Journal of Finance 57: 1201–38. [Google Scholar] [CrossRef]
- Chen, Shumin, Zhongfei Li, and Kemian Li. 2010. Optimal investment-reinsurance policy for an insurance company with VaR constraint. Insurance: Mathematics and Economics 47: 144–53. [Google Scholar] [CrossRef]
- Constantinides, George M. 1990. Habit formation: A resolution of the equity premium puzzle. Journal of Political Economy 98: 519–43. [Google Scholar] [CrossRef]
- Cooley, Philip L., Carl M. Hubbard, and Daniel T. Walz. 1998. Retirement savings: Choosing a withdrawal rate that is sustainable. AAII Journal 10: 16–21. [Google Scholar]
- Goldberg, David E., and John H. Holland. 1988. Genetic algorithms and machine learning. Machine Learning 3: 95–99. [Google Scholar] [CrossRef]
- Huang, Lixin, and Hong Liu. 2007. Rational inattention and portfolio selection. The Journal of Finance 62: 1999–2040. [Google Scholar] [CrossRef]
- Kacperczyk, Marcin, Stijn Van Nieuwerburgh, and Laura Veldkamp. 2016. A rational theory of mutual funds’ attention allocation. Econometrica 84: 571–626. [Google Scholar] [CrossRef]
- Kushner, Harold J., and Paul Dupuis. 2001. Numerical Methods for Stochastic Control Problems in Continuous Time. Berlin: Springer. [Google Scholar]
- Liptser, Robert S., and Albert N. Shiryaev. 2007. Statistics of Random Processes, II: Applications. Berlin: Springer. [Google Scholar]
- Liu, Baoding, and Ruiqing Zhao. 1998. Stochastic Programming and Fuzzy Prgramming. Beijing: Tsinghua University Press. [Google Scholar]
- Luo, Yufei. 2016. Robustly strategic consumption-portfolio rules with informational frictions. Management Science 63: 4158–74. [Google Scholar] [CrossRef]
- Maćkowiak, Bartosz, and Mirko Wiederholt. 2015. Business cycle dynamics under rational inattention. The Review of Economic Studies 82: 1502–32. [Google Scholar] [CrossRef]
- Mehra, Rajnish. 2006. The equity premium puzzle: A review. Foundations and Trends in Finance 2: 1–81. [Google Scholar] [CrossRef]
- Mitchell, Melanie. 1996. An Introduction to Genetic Algorithms. Cambridge: MIT Press. [Google Scholar]
- Sadeghi, Javad, Saeid Sadeghi, and Seyed Taghi Akhavan Niaki. 2014. Optimizing a hybrid vendor-managed inventory and transportation problem with fuzzy demand: An improved particle swarm optimization algorithm. Information Sciences 272: 126–44. [Google Scholar] [CrossRef]
- Sims, Christopher A. 2003. Implications of rational inattention. Journal of Monetary Economics 50: 665–90. [Google Scholar] [CrossRef]
- Sims, Christopher A. 2006. Rational inattention: Beyond the linear-quadratic case. The American Economic Review 96: 158–63. [Google Scholar] [CrossRef]
- Steiner, Jakub, Colin Stewart, and Filip Matĕjka. 2017. Rational inattention dynamics: Inertia and delay in decision-making. Econometrica 85: 521–53. [Google Scholar] [CrossRef]
- Yiu, Ka-Fai Cedric. 2004. Optimal portfolios under a value-at-risk constraint. Journal of Economic Dynamics and Control 28: 1317–34. [Google Scholar] [CrossRef]
- Yiu, Ka-Fai Cedric, Jingzhen Liu, Tak Kuen Siu, and Wai-Ki Ching. 2010. Optimal portfolios with regime switching and value-at-risk constraint. Automatica 46: 979–89. [Google Scholar] [CrossRef]
- Yong, Jiongmin, and Xunyu Zhou. 1999. Stochastic Controls Hamiltonian Systems and HJB Equations. New York: Springer. [Google Scholar]
- Zhang, Jun, Zhi-hui Zhan, Ying Lin, Ni Chen, Yue-jiao Gong, Jing-hui Zhong, Henry S. H. Chung, Yun Li, and Yu-hui Shi. 2011. Evolutionary computation meets machine learning: A survey. Computational Intelligence Magazine 6: 68–75. [Google Scholar] [CrossRef]
- Zhang, Nan, Zhuo Jin, Shuanming Li, and Ping Chen. 2016. Optimal reinsurance under dynamic VaR constraint. Insurance: Mathematics and Economics 71: 232–43. [Google Scholar] [CrossRef]

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Jin, Z.; Yang, Z.; Yuan, Q.
A Genetic Algorithm for Investment–Consumption Optimization with Value-at-Risk Constraint and Information-Processing Cost. *Risks* **2019**, *7*, 32.
https://doi.org/10.3390/risks7010032

**AMA Style**

Jin Z, Yang Z, Yuan Q.
A Genetic Algorithm for Investment–Consumption Optimization with Value-at-Risk Constraint and Information-Processing Cost. *Risks*. 2019; 7(1):32.
https://doi.org/10.3390/risks7010032

**Chicago/Turabian Style**

Jin, Zhuo, Zhixin Yang, and Quan Yuan.
2019. "A Genetic Algorithm for Investment–Consumption Optimization with Value-at-Risk Constraint and Information-Processing Cost" *Risks* 7, no. 1: 32.
https://doi.org/10.3390/risks7010032