The Attributes
We define four attributes in this model.
Three of the attributes, RATE, UB and V, are for storing data. RATE stores the expected return for each asset, UB stores the upper bound on the fraction of the asset allowed in the portfolio, and V stores the covariance matrix. (Note the covariance matrix is symmetric, and larger portfolio models would benefit from storing just half of the matrix, rather than the entire matrix as we have done here for simplicity reasons.)
The final attribute, X, constitutes the decision variables for the model. Specifically, X( i) is the fraction of the portfolio devoted to asset i.