1
votes

I have a portfolio of 5 stocks for which I want to find an optimal mix of minimizing portfolio variance and maximizing expected future dividends. The latter is from analysts forecasts. My problem is that I know how to solve an minimum variance problem but I am not sure how to put the quadratic form into the right matrix form for the objective function of quadprog.

The standard minimum variance problem reads

Min! ( portfolio volatility )

where
r has the 252 daily returns of the five stocks,
d has the expected yearly dividend yields ( where firm_A pays 1 %, firm_B pays 2 % etc, )

and I have programmed it as follows

dat = rep( rnorm( 10, mean = 0, sd = 1 ), 252*5 )
r   = matrix( dat, nr = 252, nc = 5 )
d   = matrix( c( 1, 2, 1, 2, 2 ) )

library(quadprog)
# Dmat (covariance) and dvec (penalized returns) are generated easily

risk.param = 0.5
Dmat = cov(r)
Dmat[is.na(Dmat)]=0

dvec = matrix(colMeans(r) * risk.param)
dvec[is.na(dvec)]=1e-5

# The weights sum up to 1
n   = 5
A   = matrix( rep( 1, n ), nr = n )
b   = 1
meq = 1

res = solve.QP( Dmat, dvec, A, b, meq = 1 )

Obviously, the returns in r a standard normal, hence each stocks gets about 20% weight.

Q1: How can I account for the fact that firm_A pays a dividend of 1, firm_B a dividend of 2, etc?

The new objective function reads:

Max! ( 0.5 * Portfolio_div - 0.5 * Portfolio_variance )

but I don't know how to hard-code it. The portfolio variance was easy to put into Dmat but the new objective function has the Portfolio_div element defined as Portfolio_div = w * d where w has the five weights.

Thanks a lot.

EDIT: Maybe it makes sense to add a higher-level description of the problem: I am able to use a minimum-variance optimization with the code above. Minimizing the portfolio variance means optimizing the weights on the variace-covariance matrix Dmat (of dimension 5x5). However, I want to add an additional part to the optimization, which are the dividends in d multiplied with the weights (hence of dimension 5x1). The same weights are also used for Dmat.

Q2: How can I add the vector d to the code?

EDIT2: I guess the answer is to simply use

dvec = -1/d

as I maximize expected dividends by minimizing the inverse of the negative.

Q3: Could someone please tell me if that's right?

1

1 Answers

0
votes

Opening a can of worms:

TLDR While I respect great work Harry MARKOWITZ ( 1990 Nobel prize ) has performed, I appreciate much more his wonderfull CACI Simulations spin-off deterministic simulation framework COMET III, than the Portfolio theory assumption, that variance per-se is the ruling minimiser driver for the portfolio optimisation process.

Driving this principal point of view

( which still may meet a bit ill-formed motivation of big funds,
that live happily from their 2-by-20 fees
due to the nature and scale of "their" skewed perspective of perception of what are direct losses,
which they recognise as a non-acquired hefty & risk-free management fees
associated with a crowd-panic churn attributed AUM erosion,
rather than the real profits & losses, gained from their (in)ability to deliver any above average AUM returns )


further,
closer to your idea
the problem is in the proper formulation of the { penalty | utility } function.

While variance is taken in classical efficient frontier theory as a penalty factor, operated in a min! global search, it has not much to do with real profit generation. You get penalised even for positive-side variance components, which is a nonsense per-se.

On the contrary, the dividend is a direct benefit, an absolute utility, entering the max! optimisation process.

So the first step in Q3 & Q1 ought be a design of a consistent utility function isolated from relative, revenue un-related factors, but containing all other absolute factors -- a cost of entry, transaction costs, rebalancing costs -- as otherwise your utility model would be misleading your portfolio wealth management strategy.

A2: Without this a-priori designed property, no one may claim a model is worth a single CPU-hour to even start the model's global optimisation efforts.