简体   繁体   中英

stack imbalance in DEoptim

I'm trying to use DEoptim but I'm getting this error, following this instructions :

Warning: stack imbalance in '.Call', 13 then 12
Warning: stack imbalance in '<-', 11 then 10

This is my code

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)

You need to get the sources from R-Forge, which have this fixed:

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

And you can build using these instructions Cannot install R-forge package using install.packages (changing where appropriate to DEoptim instead of returnanalytics)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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