You are on page 1of 11

ECON5009

COMPUTATIONAL PROJECT
Financial Markets, Securities and Derivatives

Prepared by:

October 27, 2022


Table of Contents
1.Introduction..............................................................................................................................................3

2. Project objective......................................................................................................................................3

3. Estimating Asset Return Moments..........................................................................................................4

3.1 Acquiring Data...................................................................................................................................5

3.2 Dealing with Missing Data.................................................................................................................5

3.3 Setting up a Benchmark.....................................................................................................................5

4. Using Classic; Mean-Variance Analysis....................................................................................................5

5. Finding a Stable Region............................................................................................................................6

6. Backtesting..............................................................................................................................................7

6.1 Turnover............................................................................................................................................9

6.2 Drawdown.........................................................................................................................................9

6.3 Average Return................................................................................................................................10

7. Next Steps..............................................................................................................................................11

8. Conclusion.............................................................................................................................................11

9. References.............................................................................................................................................11
1.Introduction
Investment decision under model uncertainty is a classic computational finance task. Secured (robust)
Asset allocation focuses with the best portfolio construction of a finite number of risky assets to
optimize anticipated return of the investment subject to controlled "risks." This method, which was
created by Harry Markowitz in 1952, estimates the trade-off between the projected return as well as the
risk associated with financial investment portfolios using mathematical approaches. Since risk is
determined by the variance of a random portfolio return, the methodology is also known as Mean
Variance Optimization (MVO).

Despite being an elegant model, investment professionals have expressed considerable doubt about its
applicability because optimal portfolios are frequently dependent on changes in the problem's input
variables (predicted returns and the covariance matrices), indicating that the input data to the MVO
framework must be very precisely estimated. An emerging area of optimization called robust
optimization provides methods for incorporating estimate risk into portfolio allocation decisions. Robust
optimizing, in general, refers to the process of providing solution to given multi - objective optimization
problem with uncertain input parameters that will produce satisfactory values for all or most
implementations of the uncertain input variables.

We will put into practice a portfolio optimization methodology that utilizes capital financial theory and
mean-variance modeling using the Dow Jones Industrial Average as a benchmark. Our objectives are to
design realistic, ideal investments that are stable over time by using consistent, repeatable methods.

2. Project objective
This project's major objective is to propose a powerful computational approach for reliable portfolio
construction in the case of asset returns characterized by a hazy discrete joint likelihood distribution.
The mean r and variance matrix of the returned vector are presummated to be known at the Markowitz
method site, and risk being defined as the variance of the return. The well-known issue posed
by reducing the risk subject to a lower constraint on the mean return leads to:

γ
max w' μ− w' Σ w
w 2

Weights add up to 1:

'
w e=1
Where you have N assets, w and μ are N×1 vectors, and Σ is an N×N matrix. e is an N×1 vector of ones.

0=μ−γ Σ w+ λe

Plugging this back into the constraint, we get:

((γ Σ)−1 ( μ+ λe))' e=1

The transpose reverses the order of the terms, and has no effect on the symmetric Σ−1
matrix:

( ) e=1
−1
( μ ' + λ e' ) Σ
γ

This can be simplified to:

' −1 ' −1
μ Σ e + λ e Σ e=γ

Solving for λ, we get

γ −μ' Σ −1 e
λ= ' −1
eΣ e

So the overall formula for the weights is:

w=( γ Σ )
−1
( μ+
γ −μ' Σ −1 e
e ' Σ−1 e
e )
3. Estimating Asset Return Moments
If stock prices can be approximately considered to be random walks, they are nonstationary and so their
moments do not exist (e.g. the second moment and also variance are infinite). We can always calculate
the sample moments but they will not be meaningful estimates of the population moments since the
latter do not exist. Hence, using the sample moments for inference about population or for forecasting
would be misleading and probably dangerous.

Meanwhile, stock returns could be considered stationary and so have some lower-order moments (e.g.
the second moment and variance are probably finite). Therefore, we can use the calculated sample
moments to get insight into the population moments, which is useful for inference and forecasting.
The main inputs for portfolio optimization are the mean and covariance of asset returns. Three steps are
required to estimate these moments: gathering data, addressing missing data, and establishing an
appropriate benchmark.

3.1 Acquiring Data


To gather return information for companies and market indices, we utilize MATLAB and Datafeed
Software tool. In this example, we use data from Yahoo! Finance to get average monthly return
information on the Dow Jones Industrial Average (DJIA), 44 blue-chip firms, and other stocks.

3.2 Dealing with Missing Data


However, historical financial information is frequently inaccurate and incomplete. To handle statistical
models with missing values, we employ the Financial Toolbox function ecmnmle (represented as NaNs in
MATLAB). In contrast to the typical ad hoc methods, this function leverages all available data to produce
the best estimations for asset return moments when NaNs are present.

3.3 Setting up a Benchmark


Because market return is the primary factor influencing stock return in capital asset valuation, we utilize
a market index as our benchmark. We may concentrate on non-market yields and risk by excluding
investment returns from the data. In our example, we deduct the DJIA return from the returns of certain
assets.

Figure 1 show mean-variance estimation

4. Using Classic; Mean-Variance Analysis


The anticipated return and risk (the standard error of market return) are shown for a specific portfolio in
overall average analysis. In order to create a scatter plot of the predicted return and the risk for each
portfolio, we generated random permutations of portfolio weighting (Figure 1). The average and the
standard deviation of a portfolio are shown by each red dot. The effective boundary is shown by the
blue line. Inefficient frontier portfolios offer the highest return for a given amount of risk or,
alternatively, the lowest risk for a given level of return. It goes without saying that a logical investor will
choose a strategy on the production possibility frontier.

Figure 2. The efficient frontier.

Using the averages and covariance matrices of individual stocks returns, the portopt function in Financial
Toolbox enables us to immediately identify which asset portfolios are located along the production
frontier.

5. Finding a Stable Region


A portfolio that was previously efficient may not be on the production frontier in later time periods
because of efficient frontier shifts over time. Furthermore, it is unclear which portfolio to choose on the
productive frontier. One way is to look at how efficient frontiers change over time and find a series of
portfolios that hold up well from one production frontier to the next. To see this stable area, we may
utilize MATLAB.
Figure 3. Efficient frontiers at one-month intervals with market returns removed

Plotted efficient frontiers are shown in Figure 2 as a function of time. With 40 etfs on each production
frontier, MATLAB estimated the frontiers at a monthly intervals. The findings were then shown. Figure 2
highlights the importance of removing the market from the data: Sequences of portfolios—those in the
deep blue area—with minimal variance in return or risk and consistently optimistic predicted returns in
comparison to the market can be found.

6. Backtesting
We can undertake an ex post assessment to see how these portfolios really functioned by looking at
turnover, recession, and realized average annual return given that we have found a group of portfolios
that are both stable and effective.
Figure 4: Backtest performance of portfolio strategy: Information ratio, Market and Cash
Figure 5: Backtest performance of portfolio strategy: Gross, Extrinsic, Intrinsic, Market and Cash

6.1 Turnover
Turnover is the term used to describe how a portfolio's assets change over over time as a result of
trading. A asset allocation with a 25% yearly turnover will replace 25% of its holdings throughout the
course of the year. Since investing is costly, a portfolio technique should have a low turnover rate. Figure
3 displays the annual turnover for the stock sequencing on our optimized frontiers. The blue line in the
graph represents the study's conclusions after accounting for market returns. Remember that the stable
zone, which comprises the first eight portfolio sequences, still has an annual turnover of 25% or less.

6.2 Drawdown
Calculating a portfolio's maximum drawdown is a useful technique to assess ex post risk. Maximum
drawdown is the percentage of a portfolio's value loss from its peak. It is the absolute poorest
performance that has ever been achieved.

The green line in Figure 4 depicts the DJIA's largest drop during our back-test period, which was about
20%. The flat portion of the blue line, which closely resembles the max drawdown of the DJIA, reflects
the maximum drawdown for the investment sequences through to the stable zone. This is an excellent
outcome since it demonstrates that the risk of these portfolios is comparable to the Dow Jones Average,
which is what we were trying to achieve.

6.3 Average Return


Finding the mean rating and confidence interval of returns for a portfolio is one of the easiest measuring
performance. We've previously established that the stable region's strategy sequences contain tolerable
risk levels in comparison to the benchmark. We graph an overall portfolio or index's average evidence
based returns vs risk. The DJIA benchmark's return and risk are depicted in Figure 5 by the red star
during the course of our backtesting period.

Figure 4. Drawdown in the stable region is the same as the DJIA

By charting the net statistical assessment of a dollar investment in the portfolios sequences against the
DJIA, we can finally assess performance with relation to the DJIA. The asset allocation sequences along
the stable zone regularly surpassed the benchmark over the backtest timeframe . In essence, the
sequences in the stable zone were the only ones that were over the DJIA's "water level".

Figure 6. Cumulative relative returns for each portfolio sequence


7. Next Steps
MATLAB offers a platform that makes financial research easier by helping data analysts to gather
information, predict stock return moments, create optimized portfolios, illustrate concepts, and
backtest outcomes.

The method shown here is a solid place to start when developing a portfolio optimization model. When
utilizing this strategy, an institutional investor will definitely wish to include trading restrictions and
transaction expenses. However, the possibility to overcome the market with minimal turnover by an
average of 150 basis points is a positive first step.

8. Conclusion
Our method finds reasonable measure of portfolio optimization as compared with the classical
Markowitz problem. Our method robustly handles real prices by accounting for the combined effect of
value-at-risk measure for the loss and expected return. The KL distance provides a good estimate of the
divergence of the probability distribution of stock prices and gives a realistic estimation of the
probability distribution of the stock prices. The risk factor acts as a regularization parameter in the
optimization problem providing a trade of between risk and expected return. This was also witnessed in
the results shown above of expected return and risk for both robust value-at-risk model

9. References
1. Black, F. and Litterman, R., 1992. Global portfolio optimization. Financial analysts journal, 48(5),
pp.28-43.
2. Jorion, P., 1992. Portfolio optimization in practice. Financial analysts journal, 48(1), pp.68-74.
3. DeMiguel, V., Garlappi, L., Nogales, F.J. and Uppal, R., 2009. A generalized approach to portfolio
optimization: Improving performance by constraining portfolio norms. Management science, 55(5),
pp.798-812.
4. Leippold, M., Trojani, F. and Vanini, P., 2004. A geometric approach to multiperiod mean variance
optimization of assets and liabilities. Journal of Economic Dynamics and Control, 28(6), pp.1079-
1113.

You might also like