Skip to content

Commit

Permalink
Auxiliaries no longer directly affect whether the model is considered…
Browse files Browse the repository at this point in the history
… dyad-dependent.
  • Loading branch information
krivit committed Feb 2, 2024
1 parent 3d07cf5 commit 00c8213
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: ergm
Version: 4.6-7323
Version: 4.6-7324
Date: 2024-02-02
Title: Fit, Simulate and Diagnose Exponential-Family Models for Networks
Authors@R: c(
Expand Down
3 changes: 2 additions & 1 deletion R/is.dyad.independent.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ is.dyad.independent.NULL <- function(object, ...) TRUE # By convention.
#' @describeIn ergm_model Tests whether the model is dyad-independent.
#' @export
is.dyad.independent.ergm_model <- function(object, ...){
! any(sapply(object$terms, function(term) is.null(term$dependence) || term$dependence))
## NB: Auxiliaries (i.e., terms without statistics) do not affect dyadic dependence.
! any(sapply(object$terms, function(term) length(term$coef.name) && (is.null(term$dependence) || term$dependence)))
}

#' @rdname is.dyad.independent
Expand Down
2 changes: 1 addition & 1 deletion vignettes/Terms-API.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ In the following, let $p = \dim(\eta) = \dim(g(y))$, the dimension of the statis

`pkgname`: a string containing the name of the `R` package containing the `C` implementation; if not specified, the package in which the `Init*ErgmTerm.*` function was found is assumed.

`dependence`: a logical value indicating whether the addition of this term to the model induces dyadic-dependence; if all terms have `dependence` set to `FALSE`, the model is inferred to be dyad-independent; if not specified, `TRUE` is assumed.
`dependence`: a logical value indicating whether the addition of this term to the model induces dyadic-dependence; if all terms (ignoring auxiliaries) have `dependence` set to `FALSE`, the model is inferred to be dyad-independent; if not specified, `TRUE` is assumed.

`emptynwstats`: a numeric vector of length $p$ providing the value of the statistic if evaluated on an empty network; if not specified or NULL, assumed to be a vector of zeros. (See `InitErgmTerm.degree()` in `R/InitEergmTerm.R` for an example.)

Expand Down

0 comments on commit 00c8213

Please sign in to comment.