DEoptim中的堆栈不平衡

时间:2015-04-03 15:42:14

标签: r

我正在尝试使用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)

1 个答案:

答案 0 :(得分:2)

您需要从R-Forge获取具有此修复的来源:

http://r-forge.r-project.org/scm/?group_id=773

您可以使用这些说明进行构建Cannot install R-forge package using install.packages(在适当情况下更改为DEoptim而不是returnanalytics)