<div dir="ltr">Hi All,<div><br></div><div style>I have a quick question on how the multiplier is used inside of the constrained_objective() function.</div><div style><br></div><div style>The code below is from lines 230-248 in constrained_objective.R for objects of class return_objective and portfolio_risk_objective.</div>
<div style><br></div><div style><div> # now set the new value of the objective output</div><div> if(inherits(objective,"return_objective")){ </div><div> if (!is.null(objective$target) & is.numeric(objective$target)){ # we have a target</div>
<div> out = out + penalty*abs(objective$multiplier)*abs(tmp_measure-objective$target)</div><div> } </div><div> # target is null or doesn't exist, just maximize, or minimize violation of constraint</div>
<div> out = out + abs(objective$multiplier)*tmp_measure</div><div> } # end handling for return objectives</div><div><br></div><div> if(inherits(objective,"portfolio_risk_objective")){</div>
<div> if (!is.null(objective$target) & is.numeric(objective$target)){ # we have a target</div><div> out = out + penalty*abs(objective$multiplier)*abs(tmp_measure-objective$target)</div><div> #should we also penalize risk too low for risk targets? or is a range another objective?</div>
<div> # # half penalty for risk lower than target</div><div> # if( prw < (.9*Riskupper) ){ out = out + .5*(penalty*( prw - Riskupper)) }</div><div> } </div><div> # target is null or doesn't exist, just maximize, or minimize violation of constraint</div>
<div> out = out + abs(objective$multiplier)*tmp_measure</div><div> } # univariate risk objectives</div><div><br></div><div><div>When specifying objectives, if we want to maximize return, we would set multiplier=-1 and if we wanted to minimize risk we would set multiplier=1 in the objective object. </div>
<div><br></div><div>Because the code below takes the absolute value of the multiplier (abs(objective$multiplier)), doesn't this make the multiplier have no effect?</div></div><div><br></div><div style>Any thoughts or insight is much appreciated.</div>
<div style><br></div><div style>Thanks,</div><div style>Ross Bennett</div></div></div>