### Simulated data

Formulas:

Preturn = f \* mean(Boeing) + g \* mean(GM)+ (1 - f - g) \* mean(Exxon)

Pstdev = sdw(f, g, 1 - f - g, Boeing, GM, Exxon)

##### # remove runs that try to use > 100% of budget

constraint = ifelse(f + g > 1, NA, 1)

Pstdev = Pstdev \* constraint

##### # Minimize risk

minr_Boeing = find_min(Pstdev, f)

minr_GM = find_min(Pstdev, g)

minr_Exxon = find_min(Pstdev, 1 - f - g)

##### # Maximize sharpe

sharpe = (Preturn / Pstdev) \* constraint

maxs_Boeing = find_max(sharpe, f)

maxs_GM = find_max(sharpe, g)

maxs_Exxon = find_max(sharpe, 1 - f - g)

Date: 2019-12-16 15:40:47