【发布时间】:2015-06-16 20:26:20
【问题描述】:
我正在尝试使用 DEoptim,但出现此错误,遵循 this instructions:
Warning: stack imbalance in '.Call', 13 then 12
Warning: stack imbalance in '<-', 11 then 10
这是我的代码
optOmega = function(x,ret,L)
{
retu = ret %*% x
obj = -Omega(retu,L=L,method="simple")
weight.penalty = 100*(1-sum(x))^2
return( obj + weight.penalty )
}
n.assets = 10
wmax = 1
lower = rep(0,n.assets)
upper = rep(wmax,n.assets)
r<- c(.1,.3,.4,.3,.02,.4,.7,.24,.3,.4)
r<-.5
res = DEoptim(optOmega,lower,upper,
control=list(NP=2000,itermax=1000,F=0.2,CR=0.8),
ret=coredata(r),L=0)
【问题讨论】:
标签: r