Hello Alexios,
I read the parma docu and the parma package seems to be great stuff.
"S" needs to be a
"m-by-m positive definite covariance matrix",
but in general a covariance matrix can also be not PD.
Do you know any R snippet or package,
which works for any covariance matrix
(including not PD ones, like the attached one) ?
Thanks in Advance
Uwe
I'm not too familiar with how fPortfolio works, but since you asked for
"alternative code" here is how you can do this with parma:
###############
library(parma)
spec = parmaspec(S = cov(datamatrix), riskB=0.1,
risk="EV",riskType="maxreward", LB = rep(0,8), UB = rep(1,8), budget=1,
forecast=colMeans(datamatrix))
weights(parmasolve(spec, solver="SOCP"))
#############
Note the following:
1. The risk (riskB) is an upper bound since this is an inequality
constraint (less than or equal to), and is available to solve for
covariance inputs using an SOCP solver (you can also solve QCQP problems
as well).
2. The solution can be completely dominated by one asset (as in the
case above) unless you change risk bound or constraints (UB, LB or some
other linear combinations ... see documentation)
3. You MUST provide a forecast vector (which is not all zeros).
Regards,
Alexios