What about the trading costs? I'm going to use a formula.

It's alpha one times 100 divided by b15, which is the average daily volume, and

the volume here I'm quoting not in per share, but in the total dollar amounts

traded because I want to keep the units of the portfolio and the units of the

volume the same. So it's 100, divided by the daily volume

in dollar terms, raised to the power beta, plus the absolute value of the

difference between the initial position and the final position, raised to the

power 1 plus beta. Alpha 2 times the volatility divided by

100 plus alpha 3 times the absolute value of the difference in the two assets.

The difference is, just to be very clear here, I'm looking at positions and not at

portfolio, so I'm just going to change these names back to.

All right. So, now I'm setting up the optimization

problem. The mean return is the just a product of

the final positions and the mean return vector up there.

The variance, take the final position, multiply it by the covariance matrix, and

multiply the, the final positions once again and that will give you the

variance. The trading cost is just the sum of the

trading cost across various assets because I've assumed that the trading

costs are going to be separable across assets.

What about the objective? The objective is b31 which is the mean,

minus lambda times b32, which is the variance, minus eta times b33 which is

the trading cost. So the first thing I'm going to do is I'm

going to set trading cost parameter to zero.

This eta to be zero. And what does that mean?

It means that I'm going to ignore liquidity constraints and I want to see

where does the portfolio selection move the asset.

So we should typically see if I just look at returns, we should start seeing more

of an investment in asset three and asset four.

Because they have high returns, but maybe not completely because of the covariance

matrices and so on. So let's run the solver to try to get

what it is, and what is solver going to do, it's going to maximize my objective

subject to the constraint that the sum of the final position must equal the sum of

the initial positions and I'm only allowing long positions here so, I'm

going to make the variables non-negative. So I solve it.

And you end up getting that basically the portfolio gets concentrated in asset

three about 22% there, 32% in asset four. 14% in asset six which is so this medium

one, 16% in asset seven, which has low liquidity and so on.

So, this is the final position when I don't take liquidity into consideration.

Now, let's put eta to be 0.1. So I have medium amount of liquidity

constraints in place, and I want to see what happens to the final portfolio.

So, let's again ask for our solver to solve it.