From 8e810570f01e2ceef62bd50737c3a9bc7944e2a3 Mon Sep 17 00:00:00 2001
From: "Pavel N. Krivitsky"
Date: Sun, 29 Sep 2024 20:43:46 +1000
Subject: [PATCH] Make it possible to disable the MPLE existence check.
references statnet/ergm#570
---
DESCRIPTION | 2 +-
R/control.ergm.R | 6 +++++-
R/ergm.mple.R | 2 +-
man/control.ergm.Rd | 4 ++++
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 85bbea8f3..916f1c6de 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,5 +1,5 @@
Package: ergm
-Version: 4.7-7393
+Version: 4.7-7394
Date: 2024-09-29
Title: Fit, Simulate and Diagnose Exponential-Family Models for Networks
Authors@R: c(
diff --git a/R/control.ergm.R b/R/control.ergm.R
index eecf5646d..2d172416a 100644
--- a/R/control.ergm.R
+++ b/R/control.ergm.R
@@ -165,6 +165,9 @@
#' simulate, the MCMC burn-in, and the MCMC interval for `Godambe`
#' and `bootstrap` methods.
#'
+#' @param MPLE.check If `TRUE` (the default), perform the MPLE
+#' existence check described by \insertCite{ScHu23c;textual}{ergm}.
+#'
#' @param MPLE.constraints.ignore If `TRUE`, MPLE will ignore all
#' dyad-independent constraints except for those due to attributes
#' missingness. This can be used to avert evaluating and storing the
@@ -523,7 +526,8 @@ control.ergm<-function(drop=TRUE,
MPLE.covariance.method ="invHess",
MPLE.covariance.sim.burnin = 1024,
MPLE.covariance.sim.interval = 1024,
- MPLE.constraints.ignore=FALSE,
+ MPLE.check = TRUE,
+ MPLE.constraints.ignore = FALSE,
MCMC.prop=trim_env(~sparse + .triadic),
MCMC.prop.weights="default", MCMC.prop.args=list(),
diff --git a/R/ergm.mple.R b/R/ergm.mple.R
index 3bc03d2a9..98f449379 100644
--- a/R/ergm.mple.R
+++ b/R/ergm.mple.R
@@ -72,7 +72,7 @@ ergm.mple<-function(s, s.obs, init=NULL,
# test whether the MPLE actually exists
# FIXME: Figure out how to test for MPLE's existence in penalised and curved MPLEs.
- if(! control$MPLE.type%in%c("penalized","logitreg")) mple.existence(pl)
+ if(control$MPLE.check && ! control$MPLE.type%in%c("penalized","logitreg")) mple.existence(pl)
message("Maximizing the pseudolikelihood.")
if(control$MPLE.type=="penalized"){
diff --git a/man/control.ergm.Rd b/man/control.ergm.Rd
index 85c83b8e1..b778fe9ba 100644
--- a/man/control.ergm.Rd
+++ b/man/control.ergm.Rd
@@ -24,6 +24,7 @@ control.ergm(
MPLE.covariance.method = "invHess",
MPLE.covariance.sim.burnin = 1024,
MPLE.covariance.sim.interval = 1024,
+ MPLE.check = TRUE,
MPLE.constraints.ignore = FALSE,
MCMC.prop = trim_env(~sparse + .triadic),
MCMC.prop.weights = "default",
@@ -289,6 +290,9 @@ other parameters control, respectively, the number of networks to
simulate, the MCMC burn-in, and the MCMC interval for \code{Godambe}
and \code{bootstrap} methods.}
+\item{MPLE.check}{If \code{TRUE} (the default), perform the MPLE
+existence check described by \insertCite{ScHu23c;textual}{ergm}.}
+
\item{MPLE.constraints.ignore}{If \code{TRUE}, MPLE will ignore all
dyad-independent constraints except for those due to attributes
missingness. This can be used to avert evaluating and storing the