I have portfolio optimal allocation problem (two assets equity and bond) and I want to use "fmincon" to minimize "PCS", which is probability of consumption shortfall.
Using Matlab code I have derived the "PCS" which is a scalar. The code is below:
Return_portfolio = equity_share*Return_equity+(1-equity_share)*Return_bondW = matrix of wealth in each periodB = matrix of withdrawal in each period P = (B < b); % matrix showing the incidence of shortfall (realized benefit is less than target)
S = (cumsum(P, 2) == 1) .* P; % Finding the first incidence of shortfall
shortprob = sum(S)/sim; % vector of shortfall probability
PCS = sum(shortprob) ; % Probability of consumption shortfall
Now I want to minimize PCS by chooing right allocation (weight) of portfoilio. Initially I assumed it to be 0.5. This is my "fmincon" set up
fun = @(eq_share) PCS x0 = [0.5; 0.5]; % initial weight of two assets
Aeq = [1, 1; ER_equity, ER_bonds];beq = [1; CS];lb = [0, 0];ub = [1, 1];[weights, PCS] = fmincon(fun, x0, Aeq, beq, lb, ub);
Can anyone tell me how is the set up correct because I am not even able to set it because my PCS is scalar and I do not how to define it in a function.
Best Answer