简体   繁体   English

营业额限制不适用于投资组合分析的投资组合优化

[英]Turnover Contraint not working in Portfolio Optimization with Portfolio Analytics

I am trying to perform a standard portfolio optimization, but with a constraint to how much the final weights of the portfolio are allowed to deviate from a set of initial weights.我正在尝试执行标准的投资组合优化,但限制了投资组合的最终权重可以偏离一组初始权重的程度。 I do this with the PortfolioAnalytics package and the following code is a MWE without any errors.我使用PortfolioAnalytics包执行此操作,以下代码是一个没有任何错误的 MWE。

# load packages and data
library(quadprog)
library(PortfolioAnalytics)
data(edhec)
dat <- edhec[,1:4]

# add initial weights to initial portfolio
funds <- c("Convertible Arbitrage" = 0.4, "CTA Global" = 0.3, "Distressed Securities" = 0.2, "Emerging Markets" = 0.1)
init.portf <- portfolio.spec(assets=funds)

# standard constraints & objectives
init.portf <- add.constraint(portfolio=init.portf, type="box", min_w=0, min_sum=0.99, max_sum=1.01)
init.portf <- add.objective(portfolio=init.portf, type="return", name="mean") 
init.portf <- add.objective(portfolio=init.portf, type="risk", name="StdDev")

# TURNOVER CONSTRAINT (MATTER OF THIS THREAD)
init.portf <- add.constraint(portfolio=init.portf, type="turnover", turnover_target=0)

# optimize portfolio
opt.portf <- optimize.portfolio(R=dat, portfolio=init.portf, trace=TRUE, optimize_method="random")

# check the weights of optimized portfolio
print.default(opt.portf$weights)

turnover_target is 0 , so the output weights should be the same as the input weights (0.4, 0.3, 0.2, 0.1) but instead they are equal weighted (0.25, 0.25, 0.25, 0.25) . turnover_target0 ,因此输出权重应与输入权重(0.4, 0.3, 0.2, 0.1)但它们的权重相等(0.25, 0.25, 0.25, 0.25) Equal weighted are the default initial weights, so somehow it seems like the initial weights I set up aren't recognized.等权重是默认的初始权重,所以不知何故,我设置的初始权重似乎无法识别。 However looking at the documentation of add.constraint or turnover_constraint doesn't help much.但是看着的文件add.constraintturnover_constraint没有太大帮助。 It kinda look's like everything should be working.看起来一切都应该正常工作。 They way I define the initial weights matches with the documentation of portfolio.spec他们以我定义初始权重的方式与portfolio.spec的文档匹配

Does anyone have an idea why my initial weights are ignored by turnover_constraint?有谁知道为什么我的初始权重被turnover_constraint 忽略了?

It seems like the turnover constraint of 0 is the problem, as the following code runs (new turnover_target = 0.1 ):似乎 0 的营业额约束是问题,因为以下代码运行(新的turnover_target = 0.1 ):

pf2 <- portfolio.spec(assets = funds)
pf2 <- add.constraint(pf2,
                      type="box", 
                      min_w = 0,
                      min_sum = 0.99,
                      max_sum = 1.01,
                      min=c(0.35, 0.25, 0.15, 0.05), 
                      max=c(0.45, 0.35, 0.25, 0.15))

pf2 <- add.constraint(portfolio=pf2, type="turnover", turnover_target=0.1)

# optimize portfolio
pf2 <- optimize.portfolio(R=dat, portfolio=pf2, trace=TRUE, optimize_method="random")

# check the weights of optimized portfolio
> print.default(pf2$weights)
Convertible Arbitrage            CTA Global Distressed Securities      Emerging Markets 
                0.350                 0.340                 0.248                 0.062   

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM