external optimizer

24 views
Skip to first unread message

cff...@gmail.com

unread,
Jan 13, 2026, 10:01:20 PMJan 13
to lavaan
Hello lavaan developers,

I am wondering if it is at all possible to use an optimizer that is not natively supported by writing a wrapper function that follows a particular function signature and passing to lavaan. I'm guessing not by looking at lav_model_estimate.R, though the documentation for control in lavOptions almost hints at this possibility "If another (external) optimizer is selected, see the manpage for that optimizer...". I have also seen other packages with this sort of functionality.

If not possible, wondering how tricky it would be to allow this or to add another optimizer, and where in the maze of code one could start.

Thank you!
Carl



Terrence Jorgensen

unread,
Feb 13, 2026, 5:44:35 AM (12 days ago) Feb 13
to lavaan
Hi Carl,

I am wondering if it is at all possible to use an optimizer that is not natively supported by writing a wrapper function that follows a particular function signature and passing to lavaan.

Not yet, but that is the primary goal of a 4-year grant I just obtained to refactor lavaan's internals. 

the documentation for control in lavOptions almost hints at this possibility "If another (external) optimizer is selected, see the manpage for that optimizer..."

 The external optimizer options are the ones listed immediately below, for the optim.method= argument.

You can take a look at the ctr_ files for contributed source code, particularly for all the Pairwise ML functionality that has been contributed by Irini's lab over the years.  I'm not sure if they wrote their own algorithm, but you might see an approach you could already adapt.  But over the 4-year grant, we are going to develop standards for contributors to provide such extensions, and supporting documentation about best practice.  Watch this space!

Best,
Terrence

Reply all
Reply to author
Forward
0 new messages