Learn R Programming

psychonetrics (version 0.15)

setestimator: Convenience functions

Description

These functions can be used to change some estimator options.

Usage

setestimator(x, estimator)

setoptimizer(x, optimizer = c("default", "nlminb", "ucminf", "nloptr_TNEWTON", "LBFGS++"), optim.args)

usecpp(x, use = TRUE)

Value

An object of the class psychonetrics (psychonetrics-class)

Arguments

x

A psychonetrics model.

estimator

A string indicating the estimator to be used

optimizer

The optimizer to be used. The following optimizers are available:

R-based optimizers:

"nlminb"

Port trust-region Newton-like optimizer from base R. Uses analytic gradients and a trust-region method that adaptively controls step sizes, making it very stable for SEM problems. This is the default and recommended optimizer for most models.

"ucminf"

Unconstrained minimization using a quasi-Newton method (via the optimr package). Does not support box constraints. Fast for unconstrained problems.

C++ based optimizer:

"LBFGS++"

L-BFGS-B optimizer from the LBFGSpp library (Yixuan Qiu). This is a pure C++ implementation that computes the objective function and gradient in a single combined call, avoiding redundant computation via internal caching. Supports box constraints. Recommended when speed is important.

NLopt-based optimizer (via nloptr):

"nloptr_TNEWTON"

Preconditioned truncated Newton with restarts from the NLopt library (via the nloptr package). Uses the NLOPT_LD_TNEWTON_PRECOND_RESTART algorithm, which builds a local quadratic model of the objective and solves the Newton system approximately using a preconditioned conjugate-gradient method. Supports box constraints and uses analytic gradients. Can handle large parameter spaces efficiently. See Dembo & Steihaug (1982) for the underlying method.

Defaults to "nlminb".

use

Logical indicating if C++ should be used (currently only used in FIML)

optim.args

List of arguments to sent to the optimizer.

Author

Sacha Epskamp

Details

The default optimizer is nlminb with the following arguments:

  • eval.max=20000L

  • iter.max=10000L

  • trace=0L

  • abs.tol=sqrt(.Machine$double.eps)

  • rel.tol=sqrt(.Machine$double.eps)

  • step.min=1.0

  • step.max=1.0

  • x.tol=1.5e-8

  • xf.tol=2.2e-14