change maximum number of iterations and convergence criteria

4,290 views
Skip to first unread message

lena.h...@googlemail.com

unread,
Feb 25, 2013, 6:33:38 AM2/25/13
to lav...@googlegroups.com
Hi,

is there any possibility to determine the maximum number of iterations for CFA and to change convergence criteria? By the way, what is the default for both?

I could not manage to find any information about these specifications for lavaan. Am I missing something?

Greetings, Lena


yrosseel

unread,
Feb 25, 2013, 12:45:09 PM2/25/13
to lav...@googlegroups.com
On 02/25/2013 12:33 PM, lena.h...@googlemail.com wrote:
> Hi,
>
> is there any possibility to determine the maximum number of iterations
> for CFA and to change convergence criteria? By the way, what is the
> default for both?

lavaan uses nlminb() per default; the control() argument can be used to
pass options to the nlminb() optimzer. See ?cfa for more details about
the control argument. For example, to set the max number of iterations,
you can use:

library(lavaan)
example(cfa)
fit <- cfa(HS.model, data=HolzingerSwineford1939, control=list(iter.max=10))

See ?nlminb for more options. The default values currently used by
lavaan (0.5-12, taken from the code):

eval.max = 20000L
iter.max = 10000L
trace = 0L
abs.tol = (.Machine$double.eps * 10)
rel.tol = 1e-9 # 1e-10 seems 'too strict'
x.tol = 1.5e-8
step.min = 2.2e-14


Yves.

lena.h...@googlemail.com

unread,
Feb 25, 2013, 1:08:43 PM2/25/13
to lav...@googlegroups.com
Thanks a lot!

Reply all
Reply to author
Forward
0 new messages