Learn R Programming

fungible (version 2.4.4)

obj_func: Objective function for optimizing RMSEA and CFI

Description

This is the objective function that is minimized by the tkl function.

Usage

obj_func(
  par = c(v, eps),
  Rpop,
  W,
  p,
  u,
  df,
  target_rmsea,
  target_cfi,
  weights = c(1, 1),
  WmaxLoading = NULL,
  NWmaxLoading = 2,
  penalty = 0,
  return_values = FALSE
)

Arguments

par

(vector) Values of model error variance (\(\nu_{\textrm{e}}\)) and epsilon (\(\epsilon\)).

Rpop

(matrix) The model-implied correlation matrix.

W

(matrix) Matrix of provisional minor common factor loadings with unit column variances.

p

(scalar) Number of variables.

u

(vector) Major common factor variances.

df

(scalar) Model degrees of freedom.

target_rmsea

(scalar) Target RMSEA value.

target_cfi

(scalar) Target CFI value.

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.

WmaxLoading

(scalar) Threshold value for `NWmaxLoading`.

NWmaxLoading

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

penalty

(scalar) Large (positive) penalty value to apply if the NWmaxLoading condition is violated.

return_values

(boolean) If `TRUE`, return the objective function value along with `Rpop`, `RpopME`, `W`, `RMSEA`, `CFI`, `v`, and `eps` values. If `FALSE`, return only the objective function value.