Skip to content

Commit 3fbaaf8

Browse files
committed
ditch MersenneTwister
1 parent 61dc4d4 commit 3fbaaf8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/pirls.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ end
213213
end
214214

215215
## simulate some data ##
216-
rng = MersenneTwister(42);
216+
rng = StableRNG(42);
217217
ng = 25
218218
ns = 500
219219
# random effect
@@ -223,16 +223,15 @@ end
223223
x = rand(rng, ns*ng);
224224

225225
@testset "inverse gaussian" begin
226-
rng = MersenneTwister(42);
227-
y = map(d -> rand(rng, d), InverseGaussian.(1. ./ sqrt.(1. .+ u + x)));
228-
dat = (u=u, id=id, x=x, y=y)
226+
rng = StableRNG(42);
227+
l = GLM.canonicallink(InverseGaussian())
229228
invgauss = GeneralizedLinearMixedModel(@formula(y ~ 1 + x + (1|id)), dat, InverseGaussian());
230229
#invgauss.optsum.optimizer = :LN_NELDERMEAD;
231230
# fit!(invgauss)
232231
end
233232

234233
@testset "gamma" begin
235-
rng = MersenneTwister(42);
234+
rng = StableRNG(42);
236235
y = map(d -> rand(rng, d), Gamma.(1. ./ (1. .+ u + x)));
237236
dat = (u=u, id=id, x=x, y=y)
238237
gamma = GeneralizedLinearMixedModel(@formula(y ~ 1 + x + (1|id)), dat, Gamma());

0 commit comments

Comments
 (0)