我使用 optimize.portfolio 和求解器 DEoptim(目标为 -0.1 的 maxDrawdown 风险目标和最大回报目标)创建最佳投资组合。但是当我绘制优化的投资组合对象时,这个投资组合似乎并不是最优的,因为存在具有相同回撤和更好回报的投资组合。有人可以解释一下吗?
library('PortfolioAnalytics')
library('PerformanceAnalytics')
library('DEoptim')
data(edhec)
ret <- edhec[, 1:10]
init.portf <- portfolio.spec(assets=colnames(ret))
init.portf <- add.constraint(portfolio=init.portf, type="full_investment")
init.portf <- add.constraint(portfolio=init.portf, type="long_only")
group_list <- list(group1=c(3),
group2=c(1, 2),
group3=c(5, 7, 8))
init.portf <- add.constraint(portfolio= init.portf,
type="group",
groups=group_list,
group_min=c(0.03, 0, 0),
group_max=c(0.032, 0.2, 0.3))
ret.obj.portf <- add.objective(portfolio=init.portf, type="return",
name="mean")
ret.obj.portf <- add.objective(portfolio = ret.obj.portf,
type = 'risk',
name = 'maxDrawdown',
arguments = list(inverse=TRUE),
target = -0.1)
ret.obj.portf$constraints[[1]]$min_sum <- 0.99
ret.obj.portf$constraints[[1]]$max_sum <- 1.01
ret.obj.portf
set.seed(123)
opt.obj.no1.1 <- optimize.portfolio(R=ret, portfolio=ret.obj.portf,
optimize_method="DEoptim", search_size=2000, trace=TRUE)
opt.obj.no1.1
chart.RiskReward(opt.obj.no1.1,
main = 'Optimized Portfolio: max return and 10% maxDD, all investments allowed',
return.col = "mean", risk.col = 'maxDrawdown')