Thanks for the compliment!

Good point! I’ll respond with a hedged yes/no.

Yes, in that if you were pedantic in interpreting everything in their right units, you could say, “well, I only want half of the variance to contribute” (setting the risk-aversion parameter to 0.5).

No, in that in practice, the risk-aversion parameter is a hyper parameter you search over so the lack of multiplied-by-two gets glossed over. What I mean is that you’d permute your risk-aversion parameter, simulate/test over those permutation over some validation period, and “pick” one for which you were satisfied with the trading characteristics (whatever it may be).

All that being said, I think I’ll go ahead and change it just to cross-my-t’s-and-dont-my-i’s.

]]>(1/2)*x^T*Q*x – d^T*x

and we’re minimizing

x^T * Sigma * x – mu^T*x

shouldn’t we use Dmat = 2*Sigma, instead of Dmat = Sigma as you suggest?

Again, thanks for the post!

]]>That said, I’m revisiting math I’ve not seen in years and am picking up linear algebra on my own.

I want to expand my knowledge to more types of non-linear programming which will help me with more sophisticated types of portfolio constructions, but am having trouble with vernacular, due to lack of some foundational education. Any suggestions on resources, sites, strategies that would help me climb the curve?

Your input would be most appreciated.

]]>There’s actually a difference in how to implement that for when shorting is allowed and when it’s long only, where the latter is much easier.

Dealing with the latter case, if you look underneath the section of “No Heavy Concentration”, you’ll see that I have this line here

`bvec < - c(1, rep(0, nrow(Dmat)), rep(-0.15, nrow(Dmat)))`

Basically, I'm applying a limit of 0.15 across the entire board. If you wish for any to be zero or one, just specify the vector of limits by hand, e.g., `c(1,1,0.15,1,0,1,1,0.15)`

, where zero implies you don't want to hold a position.

There’s much more nuances than can be obtained in a reply, so I’ll link this writing, which breaks down the math: https://www.wpi.edu/Pubs/E-project/Available/E-project-042707-112035/unrestricted/TurnoverConstraintsMQP.pdf

]]>That is |w_1| + |w_2| .. + |w_n| = 0 for 1<=i <=n

2. y_1 + y_2 … + y_n <= 3.

3. w_1 <= y_1

-w_1 <= y_1

w_2 <= y_2

-w_2 <= y_2

…

But how can we do this using quadprog in R?

]]>Sorry if it wasn’t clear. If you don’t already have two keys, you will need to do the more expensive option, that is, including “Ford Parts” and labor, it’s around $250.

If you already have two keys, then you can program a spare key for yourself, without need of Ford. This comes out to around $15 if you buy a “blank” key off of Ebay.

]]>