<br><br><div class="gmail_quote">On Fri, Jul 12, 2013 at 9:57 PM, Brian G. Peterson <span dir="ltr"><<a href="mailto:brian@braverock.com" target="_blank">brian@braverock.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br></div><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Cardinality Constraints<br>
I thought I had a good handle on cardinality constraints to set a limit<br>
on the maximum number of positions. This is implemented in<br>
random_portfolios by using fn_map and specifying max_pos as a position<br>
limit constraint. This is also currently working with DEoptim by using<br>
the optional function argument fnMap=fn_map. This is not doable with<br>
quadprog. This is supported in rglpk. I suppose we can use the fn_map<br>
function for the other solvers, pso and GenSA. Am I missing a different<br>
application of cardinality constraint?<br>
</blockquote>
<br></div>
No, I just missed this code, this sounds right.  I'm not in front of the code right now, but have a couple questions:<br>
- is your method compatible with the one used by glpk?<br></blockquote><div> </div><div>Yes, I've implemented basic position limit constraints with max_pos for problems to maximize return and minimize sample CVaR/ETL/ES using Rglpk.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
- does it support both long and short cardinality constraints? (e.g. from the total universe, 20 long and 20 short?)<br></blockquote><div><br></div><div>Not quite, it just limits the total number of non-zero weights. I think I should be able to implement this fairly easily in fn_map, but I'm not quite sure how to set this up in Rglpk.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
- does it support group cardinality constraints? (e.g. max 5 technology, max 10 consumer goods, max 5 manufacturing, etc?)</blockquote><div><br></div><div>No, I had not even considered this. I should be able to implement this in the fn_map function and modify the group_fail function to check for the number of assets per group.</div>
<div><br></div><div>Ross</div></div><br>