Re: [R] stop criteria when L-BFGS-B needs finite values of 'fn' in optim

2007-07-31 Thread Ben Bolker
Dae-Jin Lee dae-jin.lee at uc3m.es writes:

 
 
 I would like to know how to include and if condition when this happen,
 could it be something like:
 
 myfun - optim() #   run my function
 
 
 if(myfun == ERROR) . #   when the error message is L-BFGS-B needs
 finite values of 'fn'
 
 

  See ?try :

e.g.

 myfun - try(optim(...))
  if (class(myfun)==try-error) { ... whatever ...
   } else {
 ... success ...
   }
  
  or tryCatch

  this is FAQ 7.32 ...

  cheers
Ben Bolker

__
R-help@stat.math.ethz.ch 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.


[R] stop criteria when L-BFGS-B needs finite values of 'fn' in optim

2007-07-30 Thread Dae-Jin Lee
Hi all!

I'm running some simulations and I need to estimate some paramaters with
optim( ),
 in some cases optim stops with the next message:

   L-BFGS-B needs finite values of 'fn' 

I would like to know how to include and if condition when this happen,
could it be something like:

myfun - optim() #   run my function


if(myfun == ERROR) . #   when the error message is L-BFGS-B needs
finite values of 'fn'


I've succesfully achieved when, for example convergence is not reached,

if(myfun$convergence != 0)

but I don't know how to do it in the other case

Any help??


Thanks in advance,

Dae-Jin



-- 
__

Dae-Jin Lee
Despacho: 7.3.J04
Tlfno: 91 624 9175
Fax:  91 624 9430
Departamento de Estadística
Av. Universidad 30, Ed. Juan Benet
28911 Leganés (Madrid)
Universidad Carlos III de Madrid

e-mail: [EMAIL PROTECTED]
   web: http://www.est.uc3m.es/daejin
__

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.