Skip to content

Commit

Permalink
Converted as many links as possible to Roxygen2 Markdown and roxygeni…
Browse files Browse the repository at this point in the history
…zed to anchor external links.
  • Loading branch information
krivit committed Oct 8, 2024
1 parent 4e5b788 commit fbbc744
Show file tree
Hide file tree
Showing 56 changed files with 387 additions and 386 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: tergm
Version: 4.2-2562
Version: 4.2-2563
Date: 2024-10-08
Title: Fit, Simulate and Diagnose Models for Network Evolution Based on Exponential-Family Random Graph Models
Authors@R: c(
Expand Down Expand Up @@ -47,7 +47,7 @@ Description: An integrated set of extensions to the 'ergm' package to analyze an
License: GPL-3 + file LICENSE
URL: https://statnet.org
VignetteBuilder: rmarkdown, knitr
RoxygenNote: 7.3.2
RoxygenNote: 7.3.2.9000
Roxygen: list(markdown = TRUE)
Config/testthat/parallel: true
Config/testthat/edition: 3
Expand Down
2 changes: 1 addition & 1 deletion R/InitErgmProposal.DynMoME.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ InitErgmProposal.discordTNT <- function(arguments, nw, ...) {
#' @templateVar name discordBDStratTNT
#' @aliases InitErgmProposal.discordBDStratTNT
#' @title Temperal TNT proposal with degree bounds
#' @description A temporal version of \code{\link[ergm:ergm-proposals]{BDStratTNT}}. Within each
#' @description A temporal version of \code{\link[ergm:BDStratTNT-ergmProposal]{BDStratTNT}}. Within each
#' mixing type, approximately 50\% of proposed toggles are made on
#' dyads, and approximately 50\% of proposed toggles are
#' proposals from the network, all subject to the bounded degree
Expand Down
4 changes: 2 additions & 2 deletions R/InitErgmTerm.netseries.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ join_nets <- function(nwl, blockID, blockName){
#'
#' @param NA.impute How missing dyads in transitioned-from networks
#' are be imputed when using conditional estimation. See argument
#' \code{imputers} of \code{\link{impute.network.list}} for details.
#' \code{imputers} of [impute.network.list()] for details.
#'
#' @return A network object with temporal metadata.
#'
Expand All @@ -59,7 +59,7 @@ join_nets <- function(nwl, blockID, blockName){
#' It is almost always better to modify the original networks and
#' regenerate the series.
#'
#' @seealso [Help on model specification][ergm-terms] for specific terms.
#' @seealso [`ergmTerm`] for specific terms.
#'
#' @examples
#'
Expand Down
18 changes: 9 additions & 9 deletions R/control.simulate.stergm.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ control.simulate.network <- function(MCMC.burnin.min = 1000,
#'
#' Auxiliary function as user interface for fine-tuning STERGM simulation.
#'
#' This function is only used within a call to the \code{\link{simulate}}
#' function. See the \code{usage} section in \code{\link{simulate.stergm}} for
#' This function is only used within a call to the [simulate()]
#' function. See the Usage section in [simulate.stergm()] for
#' details.
#'
#' These functions are included for backwards compatibility, and users are
#' encouraged to use \code{control.simulate.tergm} or
#' \code{control.simulate.formula.tergm} with the \code{\link{simulate.tergm}}
#' \code{control.simulate.formula.tergm} with the [simulate.tergm()]
#' family of functions instead. When a
#' \code{control.simulate.stergm} or \code{control.simulate.network} object
#' is passed to one of the \code{\link{simulate.stergm}} functions,
#' the corresponding \code{\link{simulate.tergm}} function is invoked,
#' is passed to one of the [simulate.stergm()] functions,
#' the corresponding [simulate.tergm()] function is invoked,
#' and uses the formation proposal control arguments, ignoring the
#' dissolution proposal control arguments.
#'
Expand All @@ -113,7 +113,7 @@ control.simulate.network <- function(MCMC.burnin.min = 1000,
#'
#' @param MCMC.prop.weights.form Specifies the proposal weighting scheme to
#' be used in the MCMC Metropolis-Hastings algorithm. Possible
#' choices may be determined by calling \code{\link{ergm_proposal_table}}.
#' choices may be determined by calling [ergm_proposal_table()].
#'
#' @param MCMC.prop.args.form An alternative,
#' direct way of specifying additional arguments to proposals.
Expand All @@ -135,9 +135,9 @@ control.simulate.network <- function(MCMC.burnin.min = 1000,
#'
#' @return A list with arguments as components.
#'
#' @seealso \code{\link{simulate.stergm}},
#' \code{\link{simulate.formula}}. \code{\link{control.stergm}}
#' performs a similar function for \code{\link{stergm}}.
#' @seealso [simulate.stergm()],
#' [simulate.formula()]. [control.stergm()]
#' performs a similar function for [stergm()].
#'
#' @keywords models
#'
Expand Down
12 changes: 6 additions & 6 deletions R/control.simulate.tergm.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#'
#' Auxiliary function as user interface for fine-tuning TERGM simulation.
#'
#' This function is only used within a call to the \code{\link{simulate}}
#' function. See the \code{usage} section in \code{\link{simulate.tergm}} for
#' This function is only used within a call to the [simulate()]
#' function. See the Usage section in [simulate.tergm()] for
#' details.
#'
#' @param
Expand All @@ -36,7 +36,7 @@
#'
#' @param MCMC.prop.weights Specifies the proposal weighting scheme to
#' be used in the MCMC Metropolis-Hastings algorithm. Possible
#' choices may be determined by calling \code{\link{ergm_proposal_table}}.
#' choices may be determined by calling [ergm_proposal_table()].
#'
#' @param MCMC.prop.args An alternative, direct way of specifying
#' additional arguments to the proposal.
Expand All @@ -54,9 +54,9 @@
#'
#' @return A list with arguments as components.
#'
#' @seealso \code{\link{simulate.tergm}},
#' \code{\link{simulate.formula}}. \code{\link{control.tergm}}
#' performs a similar function for \code{\link{tergm}}.
#' @seealso [simulate.tergm()],
#' [simulate.formula()]. [control.tergm()]
#' performs a similar function for [tergm()].
#'
#' @keywords models
#'
Expand Down
30 changes: 15 additions & 15 deletions R/control.stergm.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#'
#' Auxiliary function as user interface for fine-tuning 'stergm' fitting.
#'
#' This function is only used within a call to the \code{\link{stergm}}
#' function. See the \code{usage} section in \code{\link{stergm}} for details.
#' This function is only used within a call to the [stergm()]
#' function. See the Usage section in [stergm()] for details.
#' Generally speaking, \code{control.stergm} is remapped to \code{control.tergm},
#' with dissolution controls ignored and formation controls used as controls
#' for the overall \code{tergm} process. An exception to this rule is the
Expand Down Expand Up @@ -49,14 +49,14 @@
#'
#' \item Initial values for the elements that are \code{NA} are fit
#' using the method specified by
#' \code{\link[=control.ergm]{control$init.method}}.
#' \code{\link[ergm:control.ergm]{control$init.method}}.
#'
#' } Passing coefficients from a previous run can be used to
#' "resume" an uncoverged \code{\link{stergm}} run.
#' "resume" an uncoverged [stergm()] run.
#' @param init.method Estimation method used to acquire initial values
#' for estimation. If \code{NULL} (the default), the initial values
#' are computed using the edges dissolution approximation (Carnegie
#' et al.) when appropriate; note that this relies on \code{\link{.extract.fd.formulae}}
#' et al.) when appropriate; note that this relies on [.extract.fd.formulae()]
#' to identify the formation and dissolution parts of the formula; the user should
#' be aware of its behavior and limitations.
#' If \code{init.method} is set to "zeros", the initial values are set to zeros.
Expand All @@ -77,9 +77,9 @@
#' between successive draws when running MCMC MLE.
#' @param CMLE.ergm A convenience argument for specifying both
#' \code{CMLE.form.ergm} and \code{CMLE.diss.ergm} at once.
#' See \code{\link{control.ergm}}.
#' See [control.ergm()].
#' @param CMLE.form.ergm Control parameters used to fit the CMLE. See
#' \code{\link{control.ergm}}.
#' [control.ergm()].
#' @param CMLE.diss.ergm
#' Ignored, with the exception of initial parameter values.
#' @param CMLE.NA.impute In STERGM CMLE, missing dyads in
Expand All @@ -89,13 +89,13 @@
#' that are not, currently, implemented. \code{CMLE.NA.impute}
#' controls how missing dyads in transitioned-from networks are be
#' imputed. See argument \code{imputers} of
#' \code{\link{impute.network.list}} for details.
#' [impute.network.list()] for details.
#'
#' By default, no imputation is performed, and the fitting stops
#' with an error if any transitioned-from networks have missing
#' dyads.
#' @param CMLE.term.check.override The method
#' \code{\link{stergm}{stergm}} uses at this time to fit a series of
#' [stergm()] uses at this time to fit a series of
#' more than two networks requires certain assumptions to be made
#' about the ERGM terms being used, which are tested before a fit is
#' attempted. This test sometimes fails despite the model being
Expand Down Expand Up @@ -141,14 +141,14 @@
#' \code{EGMME.MCMC.burnin.min} and \code{EGMME.MCMC.burnin.max} to
#' the same value.
#' @param SAN.maxit When \code{target.stats} argument is passed to
#' [ergm()], the maximum number of attempts to use \code{\link{san}}
#' [ergm()], the maximum number of attempts to use [san()]
#' to obtain a network with statistics close to those specified.
#' @param SAN.nsteps.times Multiplier for \code{SAN.nsteps} relative to
#' \code{MCMC.burnin}. This lets one control the amount of SAN burn-in
#' (arguably, the most important of SAN parameters) without overriding the
#' other SAN defaults.
#' @param SAN SAN control parameters. See
#' \code{\link{control.san}}
#' [control.san()]
#' @param SA.restarts Maximum number of times to restart a failed
#' optimization process.
#' @param SA.burnin Number of time steps to advance the starting
Expand All @@ -161,7 +161,7 @@
#' heatmap representing the estimated gradient.
#'
#' Do NOT use these with non-interactive plotting devices like
#' \code{\link{pdf}}. (In fact, it will refuse to do that with a
#' [pdf()]. (In fact, it will refuse to do that with a
#' warning.)
#' @param SA.max.plot.points If \code{SA.plot.progress==TRUE}, the
#' maximum number of time points to be plotted. Defaults to 400. If
Expand Down Expand Up @@ -299,9 +299,9 @@
#' deprecated; a warning message is printed in case of deprecated arguments.
#'
#' @return A list with arguments as components.
#' @seealso \code{\link{stergm}},\code{\link{tergm}},\code{\link{control.tergm}}. The
#' \code{\link{control.simulate.stergm}} function performs a similar
#' function for \code{\link{simulate.tergm}}.
#' @seealso [stergm()], [tergm()], [control.tergm()]. The
#' [control.simulate.stergm()] function performs a similar
#' function for [simulate.tergm()].
#' @references Boer, P., Huisman, M., Snijders,
#' T.A.B., and Zeggelink, E.P.H. (2003), StOCNET User\'s
#' Manual. Version 1.4.
Expand Down
28 changes: 14 additions & 14 deletions R/control.tergm.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#'
#' Auxiliary function as user interface for fine-tuning 'tergm' fitting.
#'
#' This function is only used within a call to the \code{\link{tergm}}
#' function. See the \code{usage} section in \code{\link{tergm}} for details.
#' This function is only used within a call to the [tergm()]
#' function. See the Usage section in [tergm()] for details.
#'
#' @param init numeric or \code{NA} vector equal in
#' length to the number of parameters in the
Expand All @@ -38,14 +38,14 @@
#'
#' \item Initial values for the elements that are \code{NA} are fit
#' using the method specified by
#' \code{\link[=control.ergm]{control$init.method}}.
#' \code{\link[ergm:control.ergm]{control$init.method}}.
#'
#' } Passing coefficients from a previous run can be used to
#' "resume" an uncoverged \code{\link{tergm}} run.
#' "resume" an uncoverged [tergm()] run.
#' @param init.method Estimation method used to acquire initial values
#' for estimation. If \code{NULL} (the default), the initial values
#' are computed using the edges dissolution approximation (Carnegie
#' et al.) when appropriate; note that this relies on \code{\link{.extract.fd.formulae}}
#' et al.) when appropriate; note that this relies on [.extract.fd.formulae()]
#' to identify the formation and dissolution parts of the formula; the user should
#' be aware of its behavior and limitations.
#' If \code{init.method} is set to "zeros", the initial values are set to zeros.
Expand All @@ -62,21 +62,21 @@
#' @param CMLE.MCMC.interval Number of Metropolis-Hastings steps
#' between successive draws when running MCMC MLE.
#' @param CMLE.ergm Control parameters used
#' to fit the CMLE. See \code{\link{control.ergm}}.
#' to fit the CMLE. See [control.ergm()].
#' @param CMLE.NA.impute In TERGM CMLE, missing dyads in
#' transitioned-to networks are accommodated using methods of
#' Handcock and Gile (2009), but a similar approach to
#' transitioned-from networks requires much more complex methods
#' that are not, currently, implemented. \code{CMLE.NA.impute}
#' controls how missing dyads in transitioned-from networks are be
#' imputed. See argument \code{imputers} of
#' \code{\link{impute.network.list}} for details.
#' [impute.network.list()] for details.
#'
#' By default, no imputation is performed, and the fitting stops
#' with an error if any transitioned-from networks have missing
#' dyads.
#' @param CMLE.term.check.override The method
#' \code{\link{tergm}{tergm}} uses at this time to fit a series of
#' [tergm()] uses at this time to fit a series of
#' more than two networks requires certain assumptions to be made
#' about the ERGM terms being used, which are tested before a fit is
#' attempted. This test sometimes fails despite the model being
Expand Down Expand Up @@ -124,14 +124,14 @@
#' \code{EGMME.MCMC.burnin.min} and \code{EGMME.MCMC.burnin.max} to
#' the same value.
#' @param SAN.maxit When \code{target.stats} argument is passed to
#' [ergm()], the maximum number of attempts to use \code{\link{san}}
#' [ergm()], the maximum number of attempts to use [san()]
#' to obtain a network with statistics close to those specified.
#' @param SAN.nsteps.times Multiplier for \code{SAN.nsteps} relative to
#' \code{MCMC.burnin}. This lets one control the amount of SAN burn-in
#' (arguably, the most important of SAN parameters) without overriding the
#' other SAN defaults.
#' @param SAN SAN control parameters. See
#' \code{\link{control.san}}
#' [control.san()]
#' @param SA.restarts Maximum number of times to restart a failed
#' optimization process.
#' @param SA.burnin Number of time steps to advance the starting
Expand All @@ -144,7 +144,7 @@
#' heatmap representing the estimated gradient.
#'
#' Do NOT use these with non-interactive plotting devices like
#' \code{\link{pdf}}. (In fact, it will refuse to do that with a
#' [pdf()]. (In fact, it will refuse to do that with a
#' warning.)
#' @param SA.max.plot.points If \code{SA.plot.progress==TRUE}, the
#' maximum number of time points to be plotted. Defaults to 400. If
Expand Down Expand Up @@ -277,9 +277,9 @@
#' \code{EGMME.MCMC.burnin.add} and \code{CMLE.MCMC.burnin} and
#' \code{CMLE.MCMC.interval}.
#' @return A list with arguments as components.
#' @seealso \code{\link{tergm}}. The
#' \code{\link{control.simulate.tergm}} function performs a similar
#' function for \code{\link{simulate.tergm}}.
#' @seealso [tergm()]. The
#' [control.simulate.tergm()] function performs a similar
#' function for [simulate.tergm()].
#' @references Boer, P., Huisman, M., Snijders,
#' T.A.B., and Zeggelink, E.P.H. (2003), StOCNET User\'s
#' Manual. Version 1.4.
Expand Down
6 changes: 3 additions & 3 deletions R/impute.network.list.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#' directives.
#'
#'
#' @param nwl A list of \code{\link{network}} objects or a
#' \code{\link{network.list}} object.
#' @param nwl A list of [`network`] objects or a
#' [`network.list`] object.
#' @param imputers A character vector giving one or more methods to
#' impute missing dyads. Currenly implemented methods are as
#' follows: \describe{ \item{`next`}{Impute the state of the same
Expand Down Expand Up @@ -53,7 +53,7 @@
#' returned, but they can be useful for imputing dyads in the last
#' network in \code{nwl}, when using \code{"next"} imputer.
#' @return A list of networks with missing dyads imputed.
#' @seealso \code{\link{network}}, \code{\link{is.na}}
#' @seealso [`network`], [is.na()]
#' @keywords manip
#' @export impute.network.list
impute.network.list <- function(nwl, imputers=c(), nwl.prepend=list(), nwl.append=list()){
Expand Down
8 changes: 4 additions & 4 deletions R/is.durational.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#'
#' These functions test whether an ERGM is duration dependent or not.
#'
#' @param object An ERGM formula, \code{\link{ergm_model}} object, or
#' \code{\link{ergm_state}} object.
#' @param object An ERGM formula, [`ergm_model`] object, or
#' [`ergm_state`] object.
#' @param \dots Unused at this time.
#' @return \code{TRUE} if the ERGM terms in the model are duration dependent;
#' \code{FALSE} otherwise.
Expand All @@ -34,14 +34,14 @@ is.durational<-function(object,...) UseMethod("is.durational")
#' @export
is.durational.NULL <- function(object, ...) FALSE # By convention.

#' @describeIn is.durational Test if the \code{\link{ergm_model}} has duration-dependent terms, which call for \code{\link{lasttoggle}} data structures.
#' @describeIn is.durational Test if the [`ergm_model`] has duration-dependent terms, which call for [`lasttoggle`] data structures.
#' @export
is.durational.ergm_model <- function(object, ...){
#' @import purrr
map(object$terms, "duration") %>% unlist %>% NVL(FALSE) %>% max %>% as.logical
}

#' @describeIn is.durational Test if the \code{\link{ergm_state}} has duration-dependent terms, which call for \code{\link{lasttoggle}} data structures.
#' @describeIn is.durational Test if the [`ergm_state`] has duration-dependent terms, which call for [`lasttoggle`] data structures.
#' @export
is.durational.ergm_state <- function(object, ...){
is.durational(object$model)
Expand Down
2 changes: 1 addition & 1 deletion R/is.lasttoggle.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' about dyad edge histories.
#'
#' @details The \code{tergm} package handles durational information attached to
#' \code{\link{network}} objects by way of the \code{time} and
#' [`network`] objects by way of the \code{time} and
#' \code{lasttoggle} network attributes. The \code{lasttoggle} data
#' structure is a 3-column matrix; the first two columns are tails
#' and heads (respectively) of dyads, and the third column is the last
Expand Down
Loading

0 comments on commit fbbc744

Please sign in to comment.