[R] Problem with convergence in optim

Rui Barradas ruipbarradas at sapo.pt
Wed May 15 20:32:46 CEST 2013


Hello,

It's impossible to tell what is happening without the function and the 
values for the other variables (including the initial parameters) but 
your setting of reltol is too small. Try using the default. It's 
sqrt(.Machine$double.eps), about 1e-8, you are using 1e-16.

Hope this helps,

Rui Barradas

Em 15-05-2013 17:02, Luis Felipe Parra escreveu:
> Hello to all,
>
> I have been using an optim with the following call:
>
> optim(param_ini,fun_errores2,Precio_mercado=Precio,anos_pagosE2=anos_pagos,control=list(maxit=10000,reltol=1e-16))
>
> depending on the intial values I'm getting the same solution but once I get
> the convergence message=10 (no convergence) and  for the others I get
> convergence message = 0
>
> Solution1:
> $par
>             beta1       beta2      beta3 lambda
> beta1 0.06537061 0.001474821 -0.0759236    0.5
>
> $e2
> [1] 74.84273
>
> $conv
> [1] 0
>
> $v
> [1] 74.84273
>
> Solution2:
> $par
>         beta1       beta2      beta3 lambda
> 1 0.06537061 0.001474822 -0.0759236    0.5
>
> $e2
> [1] 74.84273
>
> $conv
> [1] 10
>
> $v
> [1] 74.84273
>
> My intuition tells me the correct solution is no convergence. Does anybody
> know why this might be happening.
>
> Thank you
>
> Felipe Parra
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>



More information about the R-help mailing list