Skip to content

Commit 70b0f2d

Browse files
committed
impose better fixed criteria
1 parent b35dc36 commit 70b0f2d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

R/EMstep.group.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,15 @@ EM.group <- function(pars, constrain, Ls, Data, PrepList, list, Theta, DERIV, so
252252
dentype=dentype, rlist=rlist, full=full, Etable=list$Etable,
253253
omp_threads=list$omp_threads)
254254
if(!is.null(fixedEtable)){
255+
if(!(Moptim %in% c('BFGS', 'L-BFGS-B', 'nlminb')))
256+
stop('Optimizer not supported when using fixedEtable input', call.=FALSE)
255257
Elist$rlist[[1]]$r1 <- fixedEtable
256-
control$maxit <- 200
258+
if(Moptim %in% c('BFGS', 'L-BFGS-B'))
259+
control$maxit <- 200
260+
else if(Moptim == 'nlminb'){
261+
control$rel.tol <- 1e-10
262+
control$iter.max <- 200
263+
}
257264
}
258265
rlist <- Elist$rlist; LL <- Elist$LL
259266
if(any(ANY.PRIOR)){

0 commit comments

Comments
 (0)