tkl: Optimize TKL parameters to find a solution with target RMSEA...

View source: R/tkl.R

tklR Documentation

Optimize TKL parameters to find a solution with target RMSEA and CFI values

Description

Find the optimal W matrix such that the RMSEA and CFI values are as close as possible to the user-specified target values.

Usage

tkl(mod, target_rmsea = NULL, target_cfi = NULL, tkl_ctrl = list())

Arguments

mod

A simFA model object.

target_rmsea

(scalar) Target RMSEA value.

target_cfi

(scalar) Target CFI value.

tkl_ctrl

(list) A control list containing the following TKL-specific arguments:

  • weights (vector) Vector of length two indicating how much weight to give RMSEA and CFI, e.g., c(1,1) (default) gives equal weight to both indices; c(1,0) ignores the CFI value.

  • v_start (scalar) Starting value to use for \nu, the proportion of uniqueness variance reallocated to the minor common factors. Note that only v as a proportion of the unique (not total) variance is supported in this function.

  • eps_start (scalar) Starting value to use for \epsilon, which controls how common variance is distributed among the minor common factors.

  • v_start (vector) A vector of length two specifying the lowest and highest acceptable values of \nu.

  • eps_start (vector) A vector of length two specifying the lowest and highest acceptable values of \epsilon.

  • NMinorFac (scalar) Number of minor common factors.

  • WmaxLoading (scalar) Threshold value for NWmaxLoading.

  • NWmaxLoading (scalar) Maximum number of absolute loadings \ge WmaxLoading in any column of W.

  • penalty (scalar) Penalty applied to objective function if the NmaxLoading condition isn't satisfied.

  • optim_type (character) Which optimization function to use, optim or ga? optim is faster, but might not converge in some cases. If optim doesn't converge, ga will be used as a fallback option.

  • max_tries (numeric) How many times to restart optimization with new start parameter values if optimization doesn't converge?

  • factr (numeric) controls the convergence of the "L-BFGS-B" method. Convergence occurs when the reduction in the objective is within this factor of the machine tolerance. Default is 1e7, that is a tolerance of about 1e-8. (when using optim).

  • maxit (number) Maximum number of iterations to use (when using optim).

  • ncores (boolean/scalar) Controls whether ga optimization is done in parallel. If TRUE, uses the maximum available number of processor cores. If FALSE, does not use parallel processing. If an integer is provided, that's how many processor cores will be used (if available).

Details

This function attempts to find optimal values of the TKL parameters \nu and \epsilon such that the resulting correlation matrix with model error (\Sigma) has population RMSEA and/or CFI values that are close to the user-specified values. It is important to note that solutions are not guaranteed to produce RMSEA and CFI values that are reasonably close to the target values; in fact, some combinations of RMSEA and CFI will be difficult or impossible to obtain for certain models (see Lai & Green, 2016). It can be particularly difficult to find good solutions when additional restrictions are placed on the minor factor loadings (i.e., using the WmaxLoading and NWmaxLoading arguments).

Optimization is fastest when the optim_type = optim optimization method is chosen. This indicates that optimization should be done using the L-BFGS-B algorithm implemented in the optim function. However, this method can sometimes fail to find a solution. In that case, I recommend setting optim_type = ga, which indicates that a genetic algorithm (implemented in ga) will be used. This method takes longer than optim but is more likely to find a solution.

References

Tucker, L. R., Koopman, R. F., & Linn, R. L. (1969). Evaluation of factor analytic research procedures by means of simulated correlation matrices. Psychometrika, 34(4), 421–459.


fungible documentation built on May 29, 2024, 8:28 a.m.