Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization freezes #25

Open
epsilon64 opened this issue Apr 5, 2017 · 1 comment
Open

Optimization freezes #25

epsilon64 opened this issue Apr 5, 2017 · 1 comment

Comments

@epsilon64
Copy link

Hi,

I'm experiencing a problem when trying to perform a derivative free optimization using NLOPT_LN_COBYLA (code below). The optimization stops at one of the iterations and remains frozen for hours (let it run for more than 24h to make sure it wasn't computing) without throwing any error.

Has this problem ever been experienced?

Thanks
Ben

  toOpt = function(w,turnThresh,stock.data){
       tCosts(w,stock.data) * j - cPMOM(w,stock.data)
  }

  
    ineqCon = function(w,stock.data,turnThresh){
    
    rbind (cTurnover(w,turnThresh,stock.data)
           ,cSumWeights.Min(w,stock.data)
           ,cSumWeights.Max(w,stock.data)
           ,cVOL(w,stock.data)
           ,cREGION.US.Min(w,stock.data)
           ,cREGION.US.Max(w,stock.data))
    
  }
  
  resOpt <- nloptr(x0 = (max.vec + min.vec )/ 2
                   ,eval_f = toOpt
                   #,eval_g_eq = eqCon
                   ,eval_g_ineq = ineqCon
                   ,lb = min.vec
                   ,ub = max.vec
                   ,opts = list('algorithm' = 'NLOPT_LN_COBYLA',
                                #'algorithm' = 'NLOPT_GN_ORIG_DIRECT',
                                #'algorithm' = 'NLOPT_GN_ISRES',
                                'xtol_rel' = 1.0e-2,
                                'maxeval' = 2500,
                                'print_level' = 2
                                )
                   ,stock.data=res.all
                   ,turnThresh = 0.22
  )  
@aadler
Copy link
Contributor

aadler commented Aug 24, 2023

It has been over six years and we know there a suggestion that nlopt itself change some of the code. I don't think there is anything we can do in nloptr alone, and I suggest this issue be close as wontfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants