Skip to content

Commit 33b9243

Browse files
author
Alexey Stukalov
committed
bootstrap: use replace_observed(...; update_int_state=true)
1 parent b41e75b commit 33b9243

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/frontend/fit/standard_errors/bootstrap.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ end
251251
# Fit one bootstrap replicate: resample, replace observed data, fit.
252252
function _fit_bootstrap_sample(sem_model, data, start; engine, fit_kwargs)
253253
boot_data = resample_with_replacement(data)
254-
boot_model = replace_observed(sem_model, boot_data)
254+
# we replace the observed data with the bootstrapped one,
255+
# but preserve any internal state that is associated with the original data
256+
boot_model = replace_observed(sem_model, boot_data; update_internal_state = true)
255257
return fit(boot_model; start_val = start, engine = engine, fit_kwargs...)
256258
end

0 commit comments

Comments
 (0)