Before the estimation process can begin, every free parameter in the model must be assigned an initial value. These starting values provide the optimizer with a first guess of where to begin searching for parameter estimates that minimize (or maximize) the fitting criterion. Although starting values are not the final estimates, they can influence how quickly the optimizer converges, and in some cases whether it converges at all.
In principle, starting values can be specified manually by the user. This approach gives the user complete control over the initialization of individual parameters. However, providing all starting values by hand can be tedious and, in some cases, difficult, particularly when the model is large or complex. For this reason, most applications rely on lavaan’s ability to generate automatic starting values. A hybrid strategy is also possible: critical parameters for which good prior information is available can be assigned user-defined starting values in the syntax, while lavaan automatically generates starting values for all remaining free parameters. This offers a balance between precision and convenience.
6.1.1 Specifying starting values manually
The most direct way to provide manual starting values is by using the start() modifier in the model syntax. Consider the following one-factor example, where starting values are assigned to all free parameters:
model <-' f =~ 1*y1 + start(0.7)*y2 + start(0.9)*y3 y1 ~~ start(1.1)*y1 y2 ~~ start(1.2)*y2 y3 ~~ start(1.3)*y3 f ~~ start(1.5)*f'fit <-sem(model, data = Demo.twolevel)parTable(fit)[c("lhs", "op", "rhs", "free", "ustart", "start", "est")]
lhs op rhs free ustart start est
1 f =~ y1 0 1.0 1.0 1.000
2 f =~ y2 1 0.7 0.7 0.733
3 f =~ y3 2 0.9 0.9 0.648
4 y1 ~~ y1 3 1.1 1.1 1.010
5 y2 ~~ y2 4 1.2 1.2 1.202
6 y3 ~~ y3 5 1.3 1.3 1.186
7 f ~~ f 6 1.5 1.5 1.978
The user-specified starting values entered in the model syntax appear in the ustart column. Since all parameters have explicit starting values, the start column, containing the final starting values used in estimation, is identical to ustart. The est column displays the final point estimates after model fitting.
An alternative is to supply starting values via the start argument, using a numeric vector that lists starting values for all free parameters. For example:
lhs op rhs free ustart start est
1 f =~ y1 0 1 1.0 1.000
2 f =~ y2 1 NA 0.7 0.733
3 f =~ y3 2 NA 0.9 0.648
4 y1 ~~ y1 3 NA 1.1 1.010
5 y2 ~~ y2 4 NA 1.2 1.202
6 y3 ~~ y3 5 NA 1.3 1.186
7 f ~~ f 6 NA 1.5 1.978
In this case, the ustart column contains only NA for the free parameters, since no values were provided directly in the syntax. Instead, the values from my_starting_values are inserted directly into the start column of the parameter table.
It is essential that the vector of starting values contains only entries for free parameters, and that the order matches the order of the parameter table. To avoid errors, it is often advisable to generate the parameter table first (perhaps without fitting the model) to check the sequence of the free parameters before supplying a vector of starting values.
6.1.2 Extracting starting values from a parameter table
If the same model has already been fitted, possibly on a different dataset, it is often convenient to reuse the parameter estimates as starting values. This can be done by supplying either a parameter table or a fitted lavaan object to the start argument of the fitting function.
When a parameter table is provided, lavaan checks for the presence of certain columns in a fixed order. If an est column is available, the values in this column corresponding to the free parameters are used as starting values. If no est column is found, lavaan looks for a start column instead. If such a column exists, its values for the free parameters are used. If neither est nor start is available, lavaan falls back on the ustart column, taking all non-missing entries for the free parameters as starting values. Any remaining parameters with NA values are assigned automatic starting values by lavaan.
6.1.3 Automatic generation of starting values
In most applications, starting values are not supplied manually, and lavaan therefore generates them automatically. If some, but not all, free parameters have assigned starting values, the missing ones are filled in automatically. The procedure depends on the value of the start argument.
When start = "simple", lavaan employs a straightforward rule-based approach:
Factor loadings are set to 0.7.
Variances are set to 1.0.
Scaling parameters (defined by the ~*~ operator) are set to 1.0.
All other parameters are set to zero.
Although rudimentary, this scheme is often sufficient to provide stable initialization and allows estimation to proceed, even when the unrestricted (\mathsf{H}_1) model-implied statistics are unavailable. Earlier versions of lavaan initialized factor loadings at 1.0, but in practice this choice led to instability in some situations. Empirical testing showed that 0.7 is generally a more robust default across a wide variety of models.
When start = "default", lavaan uses a more refined procedure that relies mainly on the unrestricted (\mathsf{H}_1) model-implied statistics. The rules are as follows:
Factor loadings: free loadings are initialized using a non-iterative estimator, the FABIN3 method, applied separately for each factor.
Residual variances of indicators are set to half of their observed variances.
Composite weights are set to 1.0 if std_lv = FALSE and 0.1 if std_lv = TRUE.
Means and intercepts are set to the unrestricted means or, if conditional_x = TRUE, to the unrestricted intercepts.
Thresholds are set to the unrestricted thresholds or, if conditional_x = TRUE, to the residual thresholds.
Means and covariances of exogenous covariates are set to their sample-based statistics.
Regressions among observed variables are set to their ordinary least squares (OLS) estimates.
Scaling parameters (defined by the ~*~ operator) are set to 1.0.
Latent variances are set to 0.05.
All other parameters are set to zero.
This strategy provides starting values that are usually close to the final estimates, improving both convergence and stability of the optimization. Most of the required quantities are taken from the unrestricted (\mathsf{H}_1) model-implied statistics (Section 5.7), with the plain sample statistics serving as a fallback when these are unavailable.
6.1.4 Detecting a poor marker indicator
By default, lavaan sets the metric of each latent variable by fixing the factor loading of the first indicator (the marker indicator) to 1.0. This works well, except when the first indicator is a poor item, in the sense that it correlates only weakly with the other indicators of the same factor. Fixing the loading of such a poor item to unity often leads to (serious) convergence problems, and the cause is not obvious to the user.
To guard against this, lavaan checks whether the first indicator of each latent variable is a poor item. The check runs once the unrestricted (\mathsf{H}_1) sample statistics are available, but before bounds and starting values are computed. The quality of an indicator is measured by its corrected item-total correlation: the correlation between the indicator and the sum score of the other indicators of the same factor, computed from the (pooled) unrestricted covariance matrix. Before the sum score is formed, the indicators are aligned with their dominant common direction, so that a reverse-coded (but otherwise good) indicator does not distort the check. If the absolute value of this correlation falls below the threshold set by the bad_marker_crit option (0.1 by default), while a clearly better indicator (with a value above the threshold) is available, lavaan issues a warning that names the latent variable, the poor marker, and its item-total correlation. Under the current default, no further action is taken: the model is estimated exactly as specified. The following example illustrates the check; the first indicator y1 is pure noise:
set.seed(123)f <-rnorm(200)Data <-data.frame(y1 =rnorm(200),y2 =0.8* f +rnorm(200, sd =0.6),y3 =0.7* f +rnorm(200, sd =0.6),y4 =0.9* f +rnorm(200, sd =0.6))fit <-cfa('f =~ y1 + y2 + y3 + y4', data = Data)
Warning: lavaan->lavaan():
the first indicator (the marker item) of the following latent variable(s)
is a poor item (low corrected item-total correlation); this may lead to
convergence problems; consider using a better indicator to set the metric,
or set bad_marker_switch = TRUE to let lavaan switch the marker
automatically (bad_marker_crit = 0 disables this check): f (y1, r = 0.01)
Warning: lavaan->lav_step11_estoptim():
the optimizer warns that a solution has NOT been found!
The first warning identifies y1 as a poor marker item; the second warning shows the consequence: the model fails to converge. The user can now either reorder the indicators (so that a good item comes first), or ask lavaan to switch the marker automatically by setting bad_marker_switch = TRUE. In that case, lavaan rebuilds the parameter table so that the best indicator (the one with the largest corrected item-total correlation in absolute value) becomes the marker instead. Because this happens before the automatic bounds and starting values are generated, both are based on the new marker:
fit <-cfa('f =~ y1 + y2 + y3 + y4', data = Data,bad_marker_switch =TRUE)
Warning: lavaan->lavaan():
the first indicator of the following latent variable(s) is a poor item;
switching to another marker item (to set the metric) to avoid convergence
problems; use bad_marker_switch = FALSE to only warn about this: f (y1, r
= 0.01 -> y4, r = 0.58)
lhs op rhs free ustart est
1 f =~ y1 1 NA 0.000
2 f =~ y2 2 NA 0.968
3 f =~ y3 3 NA 0.806
4 f =~ y4 0 1 1.000
The warning explains that the marker was switched from y1 to y4, and the parameter table confirms that the loading of y4 (rather than y1) is now fixed to 1.0; the model converges without problems. The switch is not the default because it silently changes the metric of the latent variable (and hence the scale of all the parameters that depend on it), which is a decision that should be left to the user.
The check is only performed in the unmodified default situation: the model was given as model syntax (not as a parameter table), the first loading is the only fixed loading of the factor (in every block) and its value is 1.0, and none of the loadings of the factor carry user-specified modifiers (labels, starting values, bounds, priors) or are referenced in user-specified constraints. If the user has set the scaling in any other way (e.g., std_lv = TRUE, or a manually chosen marker), nothing is checked, and the parameter table is left untouched. Moreover, the switching mechanism can never make convergence worse: if the model with the switched marker(s) fails to converge, lavaan automatically reverts to the original marker(s) and refits the model. Composites (defined by the <~ operator) receive a similar treatment, but using the implied relative weight of the first indicator as the quality measure. Setting bad_marker_crit = 0 disables the check (and its warning) entirely; values larger than the default 0.1 make the check stricter.
6.1.5 Inspecting starting values
After a model has been fitted, starting values can be examined in two different ways. The first method is through the parameter table. In the example below, the default starting values computed by lavaan are used:
model <-'f =~ y1 + y2 + y3'fit <-sem(model, data = Demo.twolevel)parTable(fit)[c("lhs", "op", "rhs", "free", "ustart", "start", "est")]
lhs op rhs free ustart start est
1 f =~ y1 0 1 1.000 1.000
2 f =~ y2 1 NA 0.733 0.733
3 f =~ y3 2 NA 0.648 0.648
4 y1 ~~ y1 3 NA 1.494 1.010
5 y2 ~~ y2 4 NA 1.132 1.202
6 y3 ~~ y3 5 NA 1.009 1.186
7 f ~~ f 6 NA 0.050 1.978
Here, the start column displays the starting values for the free parameters.
The second method uses the lavInspect() function with the "start" option:
lavInspect(fit, "start")
$lambda
f
y1 1.000
y2 0.733
y3 0.648
$theta
y1 y2 y3
y1 1.494
y2 0.000 1.132
y3 0.000 0.000 1.009
$psi
f
f 0.05
This command returns the starting values, together with the fixed values, as they appear in the model matrices.
6.2 Parameter bounds
In addition to starting values, lavaan can also assign parameter bounds, that is, lower and/or upper limits on the admissible values of certain free parameters. These bounds are not required for estimation, but when present they may help the optimizer (see Section 7.1) by restricting the search space to values that are meaningful or numerically stable. In particular, bounds can prevent the optimizer from exploring implausible regions of the parameter space, which in turn may increase the chances of convergence. This matters most in small samples, where the likelihood surface is often flat or nearly flat, so that the optimizer may move into regions of the parameter space that are statistically implausible (e.g., large negative variances).
6.2.1 Manual bounds
The most direct way to impose bounds is to specify them explicitly in the model syntax using the lower() and upper() modifiers. For example:
model <-' f =~ y1 + lower(0)*y2 + y3 f ~~ upper(2)*f'
Here, the loading of y2 on f is constrained to be non-negative, and the variance of f is constrained to be at most 2. The modifiers accept a single numeric value that serves as the lower or upper limit for that parameter. In a multiple-group model, a vector with one value per group (for example, lower(c(0.5, 0.3))*y2) sets a different limit in each group, in the same way as the start() modifier.
After fitting the model, the bounds that were used during estimation can be inspected with the parTable() function. For example:
model <-' f =~ y1 + lower(0.3)*y2 + upper(3)*y3 f ~~ upper(2)*f'fit <-sem(model, data = Demo.twolevel)parTable(fit)[c("lhs", "op", "rhs", "ustart", "free", "lower", "upper", "est")]
lhs op rhs ustart free lower upper est
1 f =~ y1 1 0 1.0 1 1.000
2 f =~ y2 NA 1 0.3 Inf 0.733
3 f =~ y3 NA 2 -Inf 3 0.648
4 f ~~ f NA 3 -Inf 2 1.978
5 y1 ~~ y1 NA 4 -Inf Inf 1.010
6 y2 ~~ y2 NA 5 -Inf Inf 1.202
7 y3 ~~ y3 NA 6 -Inf Inf 1.186
The lower and upper columns contain -Inf and +Inf by default. Any manually specified bound overwrites the default for that parameter. Bounds are only relevant for free parameters. If a parameter (e.g., the factor loading f =~ y1 on the first row) is fixed to a constant, then the lower and upper bounds are also set to that constant.
6.2.2 Automatic bounds
Rather than specifying bounds parameter by parameter, lavaan can generate data-driven bounds automatically. These bounds are computed from the sample statistics before estimation begins, and are designed to keep the optimizer within a region of the parameter space that is statistically plausible for the observed data (De Jonckere & Rosseel, 2022).
Automatic bounds are activated by the bounds argument of the fitting functions (sem(), cfa(), etc.). The main options are:
bounds = "none" (the default): no automatic bounds are applied.
bounds = TRUE or bounds = "wide": activates the default automatic bounding scheme (described below).
bounds = "standard": a tighter version that uses exact data-derived limits without any widening.
bounds = "pos.var": only imposes lower bounds of zero on all observed and latent variable variances.
bounds = "pos.ov.var": only imposes lower bounds of zero on observed variable variances.
bounds = "pos.lv.var": only imposes lower bounds of zero on latent variable variances.
For example, to fit a CFA model with wide automatic bounds:
lhs op rhs ustart free lower upper est
1 f =~ y1 1 0 1.000 1.000 1.000
2 f =~ y2 NA 1 -3.304 3.304 0.733
3 f =~ y3 NA 2 -3.118 3.118 0.648
4 y1 ~~ y1 NA 3 -0.134 3.227 1.010
5 y2 ~~ y2 NA 4 -0.113 2.717 1.202
6 y3 ~~ y3 NA 5 -0.101 2.421 1.186
7 f ~~ f NA 6 0.299 3.795 1.978
6.2.3 How automatic bounds are computed
The way bounds are computed depends on how the metric of the latent variable is set. lavaan supports two common identification strategies: fixing the variance of the factor to unity (std_lv = TRUE), or fixing the first factor loading to unity (the default, std_lv = FALSE). The two strategies lead to different bound formulas, which are described below for a single-factor model with indicators y_1, \ldots, y_P.
When std_lv = TRUE, the factor variance is fixed at 1. All factor loadings are therefore free parameters. For each indicator y_p we have
\text{Var}(y_p) = \lambda_p^2 \cdot 1 + \text{Var}(\epsilon_p),
so |\lambda_p| \leq \sqrt{\text{Var}(y_p)} and \text{Var}(\epsilon_p) \leq \text{Var}(y_p). The standard bounds for this setting are:
Table 6.1: Standard lower and upper bounds for the factor variance, factor loadings, and residual variances of a one-factor model, fixing the variance of the factor to unity for identification (std_lv = TRUE).
Parameter
Lower bound
Upper bound
\text{Var}(f)
1
1
\lambda_p
-\sqrt{\text{Var}(y_p)}
+\sqrt{\text{Var}(y_p)}
\text{Var}(\epsilon_p)
0
\text{Var}(y_p)
Because the factor variance is fixed, its bounds are trivially equal to its fixed value. The loading and residual-variance bounds follow directly from the variance decomposition above.
When std_lv = FALSE (the default), the metric is set by fixing the first factor loading to unity: \lambda_1 = 1. The first indicator y_1 is called the marker indicator. Its variance satisfies
\text{Var}(y_1) = \text{Var}(f) + \text{Var}(\epsilon_1),
so the factor variance is at most \text{Var}(y_1). For the free loadings (p \neq 1) the variance equation is
\text{Var}(y_p) = \lambda_p^2 \,\text{Var}(f) + \text{Var}(\epsilon_p),
from which a finite bound on \lambda_p can only be derived if the factor variance is bounded away from zero.
To obtain a positive lower bound for the factor variance, lavaan assumes a minimum reliability \text{Rel}(y_1) for the marker indicator. The minimum reliability controls the upper bound on the residual variance of the marker:
\text{Var}(\epsilon_1) \leq \bigl[1 - \text{Rel}(y_1)\bigr] \cdot \text{Var}(y_1).
It then follows from the variance equation for y_1 that the factor variance is bounded below by
\psi^{(l)} = \text{Var}(y_1) - \bigl[1 - \text{Rel}(y_1)\bigr] \cdot \text{Var}(y_1)
= \text{Rel}(y_1) \cdot \text{Var}(y_1).
For a free loading \lambda_p (p \neq 1), the upper bound is then
|\lambda_p| \leq \sqrt{\frac{\text{Var}(y_p)}{\psi^{(l)}}}.
The standard bounds for this setting are:
Table 6.2: Standard lower and upper bounds for the factor variance, factor loadings, and residual variances of a one-factor model, fixing the first factor loading to unity for identification (std_lv = FALSE). The lower bound for the factor variance is \psi^{(l)} = \text{Rel}(y_1) \cdot \text{Var}(y_1), where \text{Rel}(y_1) is a user-specified minimum reliability for the marker indicator y_1.
Parameter
Lower bound
Upper bound
\text{Var}(f)
\psi^{(l)}
\text{Var}(y_1)
\lambda_1
1
1
\lambda_p (p \neq 1)
-\sqrt{\text{Var}(y_p)/\psi^{(l)}}
+\sqrt{\text{Var}(y_p)/\psi^{(l)}}
\text{Var}(\epsilon_1)
0
(1-\text{Rel}(y_1))\cdot\text{Var}(y_1)
\text{Var}(\epsilon_p)
0
\text{Var}(y_p)
The minimum reliability defaults to \text{Rel}(y_1) = 0.1, which is a very conservative assumption: it only requires the marker to explain at least 10% of its own variance. This leads to wide bounds that help convergence without substantially distorting the estimates. The value is controlled by min_reliability_marker in optim_bounds.
In a structural model, latent variables that are regressed on other latent variables have a residual variance rather than a total variance as their free parameter. The upper bound for such a residual variance is taken to be \text{Var}(y_1), the variance of the marker indicator. The lower bound is set to a small positive constant min_var_lv_endo (default 0.005) rather than \psi^{(l)}, because allowing the residual variance to collapse to zero would imply perfect predictability of that latent variable, which is generally not of interest.
For a free covariance between two variables x and y, the bound is derived from the Cauchy–Schwarz inequality: a correlation cannot exceed 1 in absolute value, so |\text{Cov}(x, y)| \leq \sqrt{\text{Var}(x) \cdot \text{Var}(y)}. lavaan uses the upper bounds on the respective variances as conservative estimates, giving
|\text{Cov}(x, y)| \leq \sqrt{u_x \cdot u_y},
where u_x and u_y are the upper variance bounds for x and y. Regression coefficients in the structural part of the model are not bounded.
6.2.4 Standard versus wide bounds
The bounds = "standard" option uses the exact data-derived limits described above. The bounds = "wide" option (the default when bounds = TRUE) widens these limits by applying scaling factors, so that the optimizer can move somewhat beyond the sample-based limits. The current widening factors (tuning constants, not statistical necessities) are:
Parameter type
Lower factor
Upper factor
ov.var
1.05
1.20
lv.var
1.00
1.30
loadings
1.10
1.10
covariances
1.00
1.00
A factor greater than 1.0 means the interval [\text{lower},\, \text{upper}] is expanded by that fraction of its width. For example, an upper factor of 1.20 for ov.var means the upper limit is increased by 20% of the original interval width.
To illustrate the difference, consider the same one-factor model used throughout this chapter, fitted to the Demo.twolevel dataset with the marker-variable approach (the default). The standard bounds are obtained with bounds = "standard":
lhs op rhs ustart free lower upper est
1 f =~ y1 1 0 1.000 1.000 1.000
2 f =~ y2 NA 1 -2.753 2.753 0.733
3 f =~ y3 NA 2 -2.599 2.599 0.648
4 y1 ~~ y1 NA 3 0.000 2.703 1.010
5 y2 ~~ y2 NA 4 0.000 2.276 1.202
6 y3 ~~ y3 NA 5 0.000 2.028 1.186
7 f ~~ f NA 6 0.299 2.988 1.978
The bounds reflect the formulas in Table 6.2 directly. For example, the factor variance (f ~~ f) has lower bound \psi^{(l)} = 0.1 \times \text{Var}(y_1) \approx 0.299 and upper bound \text{Var}(y_1) \approx 2.988. The free loadings (f =~ y2 and f =~ y3) are bounded symmetrically by \pm\sqrt{\text{Var}(y_p)/\psi^{(l)}}.
The wide bounds are obtained with bounds = "wide" (or equivalently bounds = TRUE):
lhs op rhs ustart free lower upper est
1 f =~ y1 1 0 1.000 1.000 1.000
2 f =~ y2 NA 1 -3.304 3.304 0.733
3 f =~ y3 NA 2 -3.118 3.118 0.648
4 y1 ~~ y1 NA 3 -0.134 3.227 1.010
5 y2 ~~ y2 NA 4 -0.113 2.717 1.202
6 y3 ~~ y3 NA 5 -0.101 2.421 1.186
7 f ~~ f NA 6 0.299 3.795 1.978
Comparing the two outputs, the loading bounds and the upper bound on the factor variance are noticeably wider. For the factor variance, the upper bound increases from \approx 2.988 to \approx 3.795 (a 30% widening of the interval). For the free loadings, both the lower and upper bounds expand by 10%. The residual variances also acquire a small negative lower bound and an enlarged upper bound due to the 5% downward and 20% upward widening of their interval.
6.2.5 Fine-grained control via optim_bounds
For full control over the bounding scheme, the optim_bounds argument accepts a named list. When optim_bounds is provided, bounds is automatically set to "user". The recognized elements are:
lower: character vector naming which parameter types receive lower bounds. Possible values: "ov.var", "lv.var", "loadings", "covariances".
upper: character vector naming which parameter types receive upper bounds. Same possible values.
lower_factor: numeric vector of scaling factors, one per element of lower. A value of 1.0 means the lower bound is not widened; a value greater than 1.0 extends the lower bound further below the data-derived limit.
upper_factor: numeric vector of scaling factors, one per element of upper. A value greater than 1.0 widens the interval upward.
min_reliability_marker: minimum reliability for the marker indicator (default 0.1). Controls the upper bound on the residual variance of the marker and the lower bound on the corresponding factor variance.
min_var_lv_endo: minimum variance for endogenous latent variables (default 0.005). Prevents degenerate solutions where the residual variance of a latent dependent variable collapses to zero.
upper_factor_between: only used for two-level models; the factor by which the between-level variances of the unrestricted model are multiplied before the upper bounds of the between-level parameters are computed (default 1.5; see Section 16.7.1).
For example, to apply lower bounds only on observed variable residual variances, with no widening:
lhs op rhs ustart free lower upper est
1 f =~ y1 1 0 1 1 1.000
2 f =~ y2 NA 1 -Inf Inf 0.733
3 f =~ y3 NA 2 -Inf Inf 0.648
4 y1 ~~ y1 NA 3 0 Inf 1.010
5 y2 ~~ y2 NA 4 0 Inf 1.202
6 y3 ~~ y3 NA 5 0 Inf 1.186
7 f ~~ f NA 6 -Inf Inf 1.978
6.2.6 Bounds in the summary() output
When a parameter estimate is at (or very close to) a lower bound, the label (lb) appears next to the estimate in the printed output. For upper-bound cases the label (ub) is used. This is illustrated in the following example:
model <-' f =~ y1 + lower(0.8)*y2 + y3 + y4 f ~~ upper(1.8)*f'fit <-sem(model, data = Demo.twolevel)summary(fit, header =FALSE)
Parameter Estimates:
Standard errors Standard
Information Expected
Information saturated (h1) model Structured
Latent Variables:
Estimate Std.Err z-value P(>|z|)
f =~
y1 1.000
y2 (lb) 0.800
y3 0.685 0.021 31.899 0.000
y4 0.202 0.026 7.762 0.000
Variances:
Estimate Std.Err z-value P(>|z|)
f (ub) 1.800
.y1 1.118 0.053 21.222 0.000
.y2 1.152 0.043 26.716 0.000
.y3 1.167 0.043 27.192 0.000
.y4 2.310 0.066 35.022 0.000
Note that parameters that are estimated to be equal to their lower or upper bound have no standard errors, and no p-value.
6.2.7 Limitations
A few limitations of the automatic bounding scheme are worth noting:
For two-level models, the bounds are computed for each level separately, from the within and between variances of the unrestricted model (see Section 16.7.1). Models with random slopes are not covered in version 0.7-4: a warning is given, and no automatic bounds are added.
Effect coding is not covered either: automatic bounds are not available when the effect_coding option is active, for the reason given next.
Linear equality constraints can invalidate the bounds. When parameters are tied together by such constraints, the automatic bounds may no longer be individually valid. In such cases it is safer to disable automatic bounds and specify manual bounds if needed.
Bounds act on one parameter at a time. They can keep every variance positive, but they cannot guarantee that a covariance matrix as a whole is positive definite (a latent correlation may still exceed one). For the covariance matrix of the latent variables, the pd_lv option of Section 7.11.4 does exactly that.
Regression coefficients are never bounded. The automatic scheme applies to variances, loadings, and covariances only; regression coefficients (structural paths) are left unbounded.
6.3 Random starting values (rstarts)
Even with automatic starting values and parameter bounds, some models may fail to converge, particularly in small samples. A second concern, independent of sample size, is that iterative optimizers can converge to a local minimum of the discrepancy function rather than finding the global minimum. Because the optimizer moves downhill from its starting point, a poor choice of starting values can lead it into a basin of attraction of a local solution that is not the true optimum. Trying multiple sets of starting values and retaining the solution with the lowest discrepancy value is a practical safeguard against both nonconvergence and local minima. This is controlled by the rstarts argument of the fitting functions.
6.3.1 How it works
When rstarts = k is specified (with k > 0), lavaan first runs the standard estimation procedure with the default starting values. It then performs k additional estimation runs, each using a newly generated set of random starting values. If any of those runs converge, the solution with the smallest value of the discrepancy function is selected. If that solution is better than the one obtained from the default starting values (or if the default run did not converge at all), it replaces the default result.
The procedure for generating one random starting-value set (mapped in the implementation notes at the end of this chapter) proceeds as follows:
The standard bounds are always computed first, regardless of whether the user requested automatic bounds. This ensures that all random values are statistically plausible for the observed data.
The latent variable (residual) variances are drawn independently from a uniform distribution within their lower and upper bounds.
The latent covariances (if any are free) are generated by first drawing a correlation uniformly from (-0.5, +0.5) and then rescaling by the square roots of the corresponding random latent variances from step 2. This guarantees that the latent variance matrix is positive definite.
The observed variable (residual) variances are drawn independently from a uniform distribution within their lower and upper bounds.
The observed residual covariances (if any are free) are handled analogously to step 3, using the already-generated observed variances.
The factor loadings are drawn uniformly within bounds that are recomputed from the random variances already generated in steps 2 and 4, using \lambda_p^{(u)} = \sqrt{\text{Var}(\epsilon_p) / \text{Var}(f)}, where \text{Var}(\epsilon_p) and \text{Var}(f) are the random values from the current run. This means the loading bounds adapt to the randomly chosen variances rather than being based on the sample-based variances.
The regression coefficients are always set to zero and are not randomized. Good starting values for regression coefficients are less critical for convergence than for the variances and loadings (De Jonckere & Rosseel, 2025).
Occasionally, the initial model-implied covariance matrix for this set of starting values is not positive-definite. In that case, lavaan proceeds nevertheless, but the optimization will typically halt immediately and the run is counted as a non-convergence for that starting value set.
6.3.2 Usage
The rstarts argument is available in sem(), cfa(), and lavaan(). For example:
model <-'f =~ y1 + y2 + y3 + y4 + y5'fit <-cfa(model, data = Demo.twolevel, rstarts =5)
Here, lavaan first fits the model with the default starting values, and then performs 5 additional runs with random starting values. The run that converged with the smallest discrepancy function value is reported as the final result.
Setting verbose = TRUE shows the progress of each attempt (not shown here):
fit <-cfa(model, data = Demo.twolevel, rstarts =5, verbose =TRUE)
The results of all random-start runs are returned by lavInspect(fit, "rstarts"), which can be informative for diagnostic purposes. Each element of the returned list corresponds to one random-start run and carries several attributes. The convergence status of each run:
When multiple runs converge to the same function value, the parameter estimates are effectively the same and the model has a unique optimum for this dataset. If the function values differ across runs, the run with the smallest value is selected, and the discrepancy between runs may indicate the presence of local minima.
6.3.3 How many random starts?
The number of sets needed depends on the model and the sample size. Simulation results in De Jonckere and Rosseel (2025) showed that for simple one-factor or two-factor models with N = 20, convergence was achieved in about 87% of cases within 150 random starting-value sets. The improvement is steep at first (many cases converge within the first 15–30 sets) and then levels off. For more complex models (e.g., models with crossloadings, or multistate-single-trait models), more sets may be needed to achieve similar convergence rates.
As a practical rule, rstarts = 10 is a reasonable default for routine use, while values of 50 to 150 may be appropriate when convergence is known to be difficult or when results need to be compared across many random draws.
Note that when rstarts > 0, the secondary default estimation attempts (e.g., with rescaled parameters or simple starting values) that lavaan tries when optim_attempts > 1 are skipped; the random starts take their place.
6.3.4 Relation to parameter bounds
Random starting values and parameter bounds are complementary strategies. Parameter bounds (Section 6.2) restrict the search space during optimization, while random starting values explore different entry points into that space. When rstarts is used, lavaan always computes standard bounds internally to define the region from which random values are drawn, even if the user has not requested automatic bounds (or has specified bounds = "none"). The user-specified bounds, if any, are used during the actual optimization runs as usual.
6.4 Implementation notes
This section collects details that are tied to the current implementation of lavaan (the R package, version 0.7-4) rather than to the concepts of the main text. Internal file and function names may change or move at any release, while everything reachable through the user interface stays put. Table 6.3 maps the procedures of this chapter to their source files.
Table 6.3: Source files behind the starting values and bounds.
Topic
File(s)
starting-values logic (lav_start())
lav_start.R
FABIN3 estimates for single-factor blocks
lav_cfa_1fac.R
automatic parameter bounds
lav_partable_bounds.R
random starting-value sets (lav_pt_random())
lav_partable_random.R
De Jonckere, J., & Rosseel, Y. (2022). Using bounded estimation to avoid nonconvergence in small sample structural equation modeling. Structural Equation Modeling: A Multidisciplinary Journal, 29(3), 412–427. https://doi.org/10.1080/10705511.2021.1982716
De Jonckere, J., & Rosseel, Y. (2025). A note on using random starting values in small sample SEM. Behavior Research Methods, 57. https://doi.org/10.3758/s13428-024-02543-9