*Can someone please tell me why the following is not giving me a solution?*


if (!is.loaded('etfdata')) data(etfdata)

R = timeSeries::returns(etfdata)

> myspec <-
parmaspec(S=cov(R),forecast=100*abs(colMeans(R)),LB=-0.05,UB=0.05,budget=0,risk='EV',riskType='minrisk',target=0.0030346)
> mysol <- parmasolve(myspec,type='QP')
> mysol

+---------------------------------+
|        PARMA Portfolio          |
+---------------------------------+
No.Assets               : 15
Problem                 : QP
Risk Measure            : EV
Objective               : minrisk
Risk                    : NA
Reward                  : NA

Error in Math.data.frame(list(Optimal_Weights = logical(0)), 4) :
  non-numeric variable in data frame: Optimal_Weights

*Whereas if I do the following I get a solution (and why is the "leverage"
constraint ignored?):*

> myspec <-
parmaspec(S=cov(R),forecast=100*abs(colMeans(R)),LB=-0.05,UB=0.05,budget=0,risk='EV',riskType='optimal',leverage=0.1)
> mysol <- parmasolve(myspec,type='QP')
> mysol

+---------------------------------+
|        PARMA Portfolio          |
+---------------------------------+
No.Assets               : 15
Problem                 : QP
Risk Measure            : EV
Objective               : optimal
Risk                    : 3e-07
Reward                  : 0.0030346

    Optimal_Weights
EWG          0.0293
EEM          0.0206
EWL          0.0174
TLT          0.0120
EZA          0.0107
EWA          0.0107
EPP          0.0106
EWC          0.0094
IWO          0.0061
IWN          0.0051
IWF         -0.0078
EWJ         -0.0214
EWU         -0.0221
IWD         -0.0309
EWQ         -0.0500
> sum(abs(mysol@solution$weight)/2)
[1] 0.1321498

	[[alternative HTML version deleted]]

