2
context("Hierarchical random graphs")
4
test_that("Starting from state works (#225)", {
8
res <- structure(list(left = c(-12, 13, -19, 4, 15, -3, 0, -13, -15,
9
-18, -6, -14, -7, -9, -8, 2, -10, 10, 11),
10
right = c(-17, -5, 17, 7, 16, -2, 1, -4, 5,
11
14, 12, 8, 3, 6, -16, 9, 18, -11, 19),
12
prob = c(0, 0.5, 0, 0, 0, 0.888888888888889,
13
0, 0.5, 0.714285714285714, 0.375,
14
0.333333333333333, 0.444444444444444, 1,
15
0.625, 0.8, 0, 0.222222222222222,
16
0.714285714285714, 1),
17
edges = c(0, 1, 0, 0, 0, 8, 0, 3, 5, 3, 2, 4,
19
vertices = c(20, 3, 3, 2, 2, 6, 2, 5, 8, 9, 7,
20
10, 3, 9, 7, 2, 10, 8, 2)),
21
.Names = c("left", "right", "prob", "edges",
25
g <- erdos.renyi.game(10, p=1/2) + erdos.renyi.game(10, p=1/2)
29
expect_that(hrg, is_equivalent_to(res))
31
hrg2 <- hrg.fit(g, hrg=hrg, start=TRUE, steps=1)
32
expect_that(hrg2, is_equivalent_to(res))