Skip to content

Commit 5e5575b

Browse files
fix bootstrap tests
1 parent 0eb04ef commit 5e5575b

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

test/examples/helper.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function test_bootstrap(model_fit; n_boot = 500)
143143
@test isapprox(se_bs, se_he, rtol = 0.2)
144144
# se_bootstrap and bootstrap |> se are close
145145
bs_samples = bootstrap(model_fit; n_boot = n_boot)
146-
@test bs_samples[:n_converged] > 990
146+
@test bs_samples[:n_converged] > 0.95*n_boot
147147
bs_samples = cat(bs_samples[:samples][BitVector(bs_samples[:converged])]..., dims = 2)
148148
se_bs_2 = sqrt.(var(bs_samples, corrected = false, dims = 2))
149149
@test isapprox(se_bs_2, se_bs, rtol = 0.05)

test/examples/multigroup/multigroup.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using StructuralEquationModels, Test, FiniteDiff, Suppressor
22
using LinearAlgebra: diagind, LowerTriangular
3+
using Statistics: var
34

45
const SEM = StructuralEquationModels
56

test/examples/political_democracy/political_democracy.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using StructuralEquationModels, Test, Suppressor, FiniteDiff
2-
using Statistics: cov, mean
2+
using Statistics: cov, mean, var
33
using Random, NLopt
44

55
SEM = StructuralEquationModels

0 commit comments

Comments
 (0)