diff --git a/DESCRIPTION b/DESCRIPTION index 327b8edea..f3716cf8b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ergm -Version: 4.7-7367 -Date: 2024-06-05 +Version: 4.7-7368 +Date: 2024-06-11 Title: Fit, Simulate and Diagnose Exponential-Family Models for Networks Authors@R: c( person(c("Mark", "S."), "Handcock", role=c("aut"), email="handcock@stat.ucla.edu"), diff --git a/R/ergm.utility.R b/R/ergm.utility.R index b892dd73d..7a6dd276c 100644 --- a/R/ergm.utility.R +++ b/R/ergm.utility.R @@ -144,6 +144,12 @@ single.impute.dyads <- function(nw, constraints=NULL, constraints.obs=NULL, min_ response <- nw %ergmlhs% "response" stopifnot(!is.null(constraints)||is.null(constraints.obs)) + if(!is.dyad.independent(constraints) || !is.dyad.independent(constraints.obs)){ + message("Model and/or observational constraints are not dyad-independent. Dyad imputation cannot be used. Please ensure your LHS network satisfies all constraints.") + if(output=="network") return(nw) + else return(ergm_state(nw)) + } + if(!is.null(constraints)){ imputable <- as.rlebdm(constraints, constraints.obs, "missing") nae <- NVL3(imputable, sum(.), 0)