Multiperiod Portfolio Optimization with Dynamic Programming and MPC
Summary
The document asks how to optimize a portfolio across multiple periods when asset holdings, trades, returns, and transaction costs are linked over time. It presents a deterministic linear programming formulation in which holdings evolve as assets are bought or sold, and contrasts solving the full horizon with repeatedly optimizing a single period. The question does not provide a worked solution to that modeling choice.
Responses point to several relevant approaches: portfolio optimization tools in R, model predictive control for planning a system’s state trajectory, and dynamic programming through a recursion over future stages. The suggestions are starting points rather than a comparative evaluation, and the cited package advice does not establish suitability for every formulation. The discussion also raises stochastic programming as a possible framework, but does not develop uncertainty scenarios or explain when decomposition is valid. Problem size, assumptions, and the treatment of future information would affect the appropriate method.
Key ideas
- The portfolio formulation links holdings across periods through asset returns and trading decisions.
- Solving each period independently may differ from optimizing the full investment horizon.
- Dynamic programming represents a multistage problem using a recursion over future states.
- Model predictive control is suggested for optimizing a system trajectory over time.
- R portfolio tools and general optimization functions are suggested, without a detailed comparison.
Tags
Full text
# multiperiod optimization using R
# multiperiod optimization using R
I'm interested in multistage optimization problems. Are there any good R packages around to solve such problems over time? I'm not at all an expert in it, so maybe someone knows a good paper / lecture notes to start with? I know classical optimization (linear optimization, convex optimiziation etc) but I've never had to deal with optimization over time. Any reference, theoretical and regarding the implementation are very welcome. I know that this is a very general question, but this is due to my (not yet) attained knowledge. If further clarification is needed I'm happy to share thix. Many thanks in advance
EDIT
Let's take for example the following paper, there we have a optimization problem of the form:
$$\max \sum_{i=1}^{n+1}r^L_ix_i^L$$
such that
$$ x^l_i=r^{l-1}_i x_i^{l-1}-y_i^l+z^l_i,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$ $$ x^l_i=r^{l-1}_{n+1} x_{n+1}^{l-1}+\sum_{i=1}^n(1-\mu^l_i)y_i^l-\sum_{i=1}^n(1+\nu_i^l)z^l_i$$ $$y^l_i\ge 0,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$ $$x^l_i\ge 0,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$ $$z^l_i\ge 0,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$ where some $x_i^l$ is the value (in dollar) of an asset $i$ at time $l$, $r_i^l$ is the asset return, $y^l_i$ and $z^l_i$ are the amount of asset sold and bought. $\mu^l_i $ and $\nu_i^l$ have also economical interpretation, but are not that important for the question. Assuming everthing is deterministic, we can solve this problem using interior points / simplex method since it is an "simple" LP. However the theory I'm looking for should give me ideas if it is optimal to solve at every time $l$ the subproblem (maximize $\sum_{i=1}^{n+1}r^l_ix^l_i$ under the corresponding constraints or is this not a good idea. I have heard / read that one could solve such kind of problem using stochastic programming, but still I'm interested in knowing how to subdivide (if possible) such kind of problems.
## Answer by Kyle Balkissoon (score 2)
https://quant.stackexchange.com/a/14740
PortfolioAnalytics, has the ability to optimize portfolios based on factors or whatever groups/characteristics you enter.
https://r-forge.r-project.org/R/?group_id=579
Please refer to the vignette in the package in the package PortfolioAnalytics (https://r-forge.r-project.org/scm/viewvc.php/pkg/PortfolioAnalytics/vignettes/?root=returnanalytics
I use it on a regular basis to solve problems similar to the one you posted above.
## Answer by user157969 (score 0)
https://quant.stackexchange.com/a/14440
There is an approach called Model Predictive Control which optimizes the state trajectory of a system over time. There doesn't seem to be suitable R packages, but I can recommend the YALMIP package as probably being a good place to start: http://users.isy.liu.se/johanl/yalmip/
## Answer by berkorbay (score 0)
https://quant.stackexchange.com/a/14773
What you refer to multiperiod optimization can also be classified under dynamic programming. You need to write a recursion (which can be nauseating at first) and any optimization function in R would do a nice job, if your problem is not too big.
For the second part, you may search for some sensitivity analysis literature but I am not totally sure about where to look at.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.