Note the "reproducible code" directive. We cannot check your
calculations.
It would not surprise me if the objective for Excel was really, really
good BUT the parameters were out of bounds or violated other constraints.
At the EUSPRIG meeting in Klagenfurt in 2004 I sat next to Dan Fijlstra
of Frontline Systems at dinner. He complained that FS had offered
Microsoft a bug fix for GRG (they supply for-money improved versions as
well as the "free" solver) and were told it wasn't wanted. Sigh.
On the other hand, I think the interface Excel provides is nicely
designed for small to medium problems.
You may also want to be very careful with the call to nloptr. It can be
tricky, rendering its results more or less meaningless.
JN
On 16-07-11 10:38 AM, Narendra Modi wrote:> Hi All,
> For a non-linear minimization optimization problem that I have, I am
> getting better objective function value in Excel(15) as compared to
> nloptr (73).
>
> the nloptr is setup as:
>
> opts = list("algorithm"="NLOPT_LN_COBYLA",
> "xtol_rel"=1.0e-8, "maxeval"= 10000)
> lb = vector("numeric",length= length(my.data.var))
>
> result <- nloptr(my.data.var,eval_f = Error.func,lb=lb,
> ub >
c(Inf,1,1,1,1,1,Inf,1,1,1,1,1,Inf,1,1,1,1,1,Inf,1,1,1,1,1),eval_g_ineq=constraint.func,opts
> = opts)
>
>
> As observed even with 10000 as maximum evaluations, the objective
> function is way off as compared to Excel's GRG which solved it in 200
> iterations.
>
> Is there a way to improve the objective function value from nloptr? OR
> is there any excel's GRG equivalent package in R.
>
> Thanks for your time!
>
> PD
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>