File tree Expand file tree Collapse file tree
src/frontend/fit/standard_errors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,27 +160,24 @@ function se_bootstrap(
160160 # pre-allocations
161161 total_sum = zero (start)
162162 total_squared_sum = zero (start)
163+ n_conv = Ref (0 )
163164 # fit to bootstrap samples
164165 if ! parallel
165166 for _ in 1 : n_boot
166- try
167- sample_data = bootstrap_sample (data)
168- new_model = replace_observed (
169- fitted. model;
170- data = sample_data,
171- specification = specification,
172- replace_kwargs... ,
173- )
174- new_fit = fit (new_model; start_val = start, engine = engine, fit_kwargs... )
175- sol = solution (new_fit)
176- conv = converged (new_fit)
177- if conv
178- n_conv[] += 1
179- @. total_sum += sol
180- @. total_squared_sum += sol^ 2
181- end
182- catch
183- n_failed[] += 1
167+ sample_data = bootstrap_sample (data)
168+ new_model = replace_observed (
169+ fitted. model;
170+ data = sample_data,
171+ specification = specification,
172+ replace_kwargs... ,
173+ )
174+ new_fit = fit (new_model; start_val = start, engine = engine, fit_kwargs... )
175+ sol = solution (new_fit)
176+ conv = converged (new_fit)
177+ if conv
178+ n_conv[] += 1
179+ @. total_sum += sol
180+ @. total_squared_sum += sol^ 2
184181 end
185182 end
186183 else
You can’t perform that action at this time.
0 commit comments