Skip to content

Commit 1b26dd0

Browse files
committed
Added a test for missing data MLE.
1 parent 7203e42 commit 1b26dd0

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ergm.multi
2-
Version: 0.3.0-4285
3-
Date: 2026-03-22
2+
Version: 0.3.0-4275
3+
Date: 2026-03-23
44
Title: Fit, Simulate and Diagnose Exponential-Family Models for Multiple or Multilayer Networks
55
Authors@R: c(person(c("Pavel", "N."), "Krivitsky", role=c("aut","cre"), email="pavel@statnet.org", comment=c(ORCID="0000-0002-9101-3362")),
66
person(c("Mark", "S."), "Handcock", role=c("ctb"), email="handcock@stat.ucla.edu"),

tests/testthat/test-missing.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
library(ergm.multi)
2+
3+
data(samplk)
4+
5+
samplk1[1,] <- NA
6+
samplk2[,2] <- NA
7+
8+
nwl <- list(samplk1, samplk2, samplk3)
9+
10+
truth <- qlogis(sum(sapply(nwl, network.edgecount, na.omit = TRUE)) /
11+
sum(sapply(nwl, network.dyadcount, na.omit = TRUE)))
12+
13+
test_that("Multilayer network with missing data", {
14+
expect_equal(coef(ergm(Layer(nwl) ~ edges)), truth, ignore_attr = TRUE)
15+
})
16+
17+
test_that("Network sample with missing data", {
18+
expect_equal(coef(ergm(Networks(nwl) ~ edges)), truth, ignore_attr = TRUE)
19+
})

0 commit comments

Comments
 (0)