From 402cd690217a9864265dd27fadbde8a6664915c5 Mon Sep 17 00:00:00 2001 From: "Pavel N. Krivitsky" Date: Mon, 8 Jan 2024 19:52:23 +1100 Subject: [PATCH] absdiffcat() no longer constructs a full sociomatrix when computing the set of achievable differences, unless nodal covariate values are all distinct. --- DESCRIPTION | 4 ++-- R/InitErgmTerm.R | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6f92420fa..ade25f1a9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ergm -Version: 4.6-7289 -Date: 2024-01-02 +Version: 4.6-7290 +Date: 2024-01-08 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/InitErgmTerm.R b/R/InitErgmTerm.R index e976830d4..9364f181b 100644 --- a/R/InitErgmTerm.R +++ b/R/InitErgmTerm.R @@ -553,7 +553,8 @@ InitErgmTerm.absdiffcat <- function(nw, arglist, ..., version=packageVersion("er nodecov <- ergm_get_vattr(attrarg, nw, accept = "numeric") attrname <- attr(nodecov, "name") - u <- sort(unique(as.vector(abs(outer(nodecov,nodecov,"-")))),na.last=NA) + unodecov <- unique(nodecov) + u <- sort(unique(as.vector(abs(outer(unodecov,unodecov,"-")))),na.last=NA) u <- u[u>0] u <- ergm_attr_levels(a$levels, nodecov, nw, levels = u)