[R] Optim(...parscale...)

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Apr 19 23:32:48 CEST 2005


Werner Bier <aliscla at yahoo.com> writes:

> Hi there,
>  
> The optim(par, fn, ...parscale...) function in R requires 'parscale' which is defined as:
>  
> "A vector of scaling values for the parameters. Optimisation is performed on 'par/parscale' and these should be comparable in the sense that a unit change in any element (??) produces a unit change in the scaled value".
>  
> I am just not understanding the "comparable...produces".
>  
> Should we compare "fn(par/parscale+1)- fn(par/parscale)" with 
> "fn(parscale+1) - fn(parscale)"? 
>  
> With this respect, we might refer to the choice of parscale=20 in the "wild function" given in the optim R documentation if you wish.
>  
> Many thanks in advance for your consideration.

You need to take a more pragmatic view. All that the help page is
trying to say is that you have a problem if realistic values for one
parameter are on the order of 0.0001-0.0010 while another parameter
varies in the thousands. This tends to cause convergence issues, and
parscale is there to bring the variables closer to a common scale. In
my experience, getting the scales right within a factor of 100 or so
is usually sufficient.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list