scaling problems in "optim"
kathie wrote:
Dear R users,
I am trying to figure out the control parameter in "optim," especially,
"fnscale" and "parscale."
In the R docu.,
------------------------------------------------------
fnscale
An overall scaling to be applied to the value of fn and gr during
optimization. If negative, turns the problem into a maximization problem.
Optimization is performed on fn(par)/fnscale.
parscale
A vector of scaling values for the parameters. Optimization is performed
on par/parscale and these should be comparable in the sense that a unit
change in any element produces about a unit change in the scaled value.
------------------------------------------------------
I cannot understand these two statements.
"Optimization is performed on fn(par)/fnscale." and
"Optimization is performed on par/parscale and these should be comparable in
the sense that a unit change in any element produces about a unit change in
the scaled value."
Would you please explain these things?
Thank you in advance.
Kathryn Lord
Well, the gist is that optim is happiest when the function values f(beta) are not too large and not too small, and ditto for df/dbeta. You may e.g. get convergence issues if your data or your "covariates" are Molar concentrations when the actual values are on the order of microMolar. "Covariates" in quotes because this is not linear, but the gradient df/dbeta plays the part in the local linearization. So you get the opportunity to rescale function values and parameters.
O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907