Skip to content

Commit 2fe8b19

Browse files
committed
make named argument consistent across parametric bootstrap methods
1 parent 6409eee commit 2fe8b19

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/simulate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function parametricbootstrap(
9797
MixedModelBootstrap(refit!(m, y₀), samp)
9898
end
9999

100-
function parametricbootstrap(nsamp::Integer, m::LinearMixedModel, β = m.β, σ = m.σ, θ = m.θ, use_threads = false)
100+
function parametricbootstrap(nsamp::Integer, m::LinearMixedModel; β = m.β, σ = m.σ, θ = m.θ, use_threads = false)
101101
parametricbootstrap(Random.GLOBAL_RNG, nsamp, m, β = β, σ = σ, θ = θ, use_threads = false)
102102
end
103103

test/pls.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,13 @@ end
313313
simulate!(fm, θ = fm.θ)
314314
@test_throws DimensionMismatch refit!(fm, zeros(29))
315315

316-
bsamp = parametricbootstrap(MersenneTwister(1234321), 100, fm, use_threads=false)
316+
# this should give the same results as passing with
317+
# MersenneTwister(1234321)
318+
# by setting the seed first, we test the method for the default RNG
319+
# and still get reproducible results which can be compared to the
320+
# multi-threaded output.
321+
Random.seed!(1234321)
322+
bsamp = parametricbootstrap(100, fm, use_threads=false)
317323
@test isa(propertynames(bsamp), Vector{Symbol})
318324
@test length(bsamp.objective) == 100
319325
@test keys(first(bsamp.bstr)) == (:objective, , , )

0 commit comments

Comments
 (0)