Skip to content

Commit

Permalink
reset parscale to TRUE at the end of each run to avoid coercion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lawrence Miller committed Aug 9, 2016
1 parent ad50136 commit f33729a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/detfct.fit.opt.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ detfct.fit.opt <- function(ddfobj, optim.options, bounds, misc.options,
# rescale_pars
if(!is.null(ddfobj$scale$formula) && (ddfobj$scale$formula != ~1) &&
!is.null(optim.options$parscale) &&
all(optim.options$parscale)&&
all(optim.options$parscale) &&
(opt.method=="nlminb") && (fitting=="all")){

# get the rescaling
Expand Down Expand Up @@ -255,6 +255,8 @@ detfct.fit.opt <- function(ddfobj, optim.options, bounds, misc.options,
# put the results in a nice format
lt <- parse.optimx(lt, lnl.last, initialvalues)
initialvalues <- lt$par
# reset parscale to be logical, it will be recalculated each time
optim.options$parscale <- TRUE
} # end rescaled nlminb

## use optimx if there are methods left
Expand Down

0 comments on commit f33729a

Please sign in to comment.