Skip to content

Commit

Permalink
Change .mard refs to .msm
Browse files Browse the repository at this point in the history
  • Loading branch information
smjenness committed Feb 18, 2016
1 parent fe01487 commit 65e8d7d
Show file tree
Hide file tree
Showing 53 changed files with 262 additions and 268 deletions.
56 changes: 28 additions & 28 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@

S3method(print,nwstats)
export(InitErgmTerm.absdiffnodemix)
export(acts.mard)
export(aging.mard)
export(acts.msm)
export(aging.msm)
export(apportion_lr)
export(assign_degree)
export(base_nw.mard)
export(births.mard)
export(calc_nwstats.mard)
export(condoms.mard)
export(control.mard)
export(deaths.mard)
export(disclose.mard)
export(edges_correct.mard)
export(base_nw.msm)
export(births.msm)
export(calc_nwstats.msm)
export(condoms.msm)
export(control.msm)
export(deaths.msm)
export(disclose.msm)
export(edges_correct.msm)
export(get_args)
export(init.mard)
export(initialize.mard)
export(param.mard)
export(position.mard)
export(prep.mard)
export(prevalence.mard)
export(progress.mard)
export(init.msm)
export(initialize.msm)
export(param.msm)
export(position.msm)
export(prep.msm)
export(prevalence.msm)
export(progress.msm)
export(reallocate_pcp)
export(reinit.mard)
export(riskhist.mard)
export(simnet.mard)
export(test.mard)
export(trans.mard)
export(tx.mard)
export(update_aiclass.mard)
export(reinit.msm)
export(riskhist.msm)
export(simnet.msm)
export(test.msm)
export(trans.msm)
export(tx.msm)
export(update_aiclass.msm)
export(update_degree)
export(update_roleclass.mard)
export(update_vl.mard)
export(updatenwp.mard)
export(verbose.mard)
export(update_roleclass.msm)
export(update_vl.msm)
export(updatenwp.msm)
export(verbose.msm)
import(EpiModel)
import(EpiModelHPC)
import(bindata)
Expand Down
12 changes: 6 additions & 6 deletions R/estimation.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
#' calculated externally to the package in a setup scenario file.
#'
#' @seealso
#' Network statistics calculated here are entered into \code{\link{base_nw.mard}}
#' Network statistics calculated here are entered into \code{\link{base_nw.msm}}
#' to construct the base network, and then into the parameters in
#' \code{\link{param.mard}}.
#' \code{\link{param.msm}}.
#'
#' @export
#'
calc_nwstats.mard <- function(time.unit = 7, method = 2,
calc_nwstats.msm <- function(time.unit = 7, method = 2,
num.B, num.W, deg.mp.B, deg.mp.W,
mdeg.inst.B, mdeg.inst.W,
qnts.B, qnts.W,
Expand Down Expand Up @@ -359,10 +359,10 @@ calc_nwstats.mard <- function(time.unit = 7, method = 2,
#' \code{netest}.
#'
#' @param nwstats An object of class \code{nwstats}, as output from
#' \code{\link{calc_nwstats.mard}}.
#' \code{\link{calc_nwstats.msm}}.
#'
#' @details
#' This function takes the output of \code{\link{calc_nwstats.mard}} and constructs
#' This function takes the output of \code{\link{calc_nwstats.msm}} and constructs
#' an empty network with the necessary attributes for race, square root of age,
#' and sexual role class. This base network is used for all three network
#' estimations.
Expand All @@ -373,7 +373,7 @@ calc_nwstats.mard <- function(time.unit = 7, method = 2,
#'
#' @export
#'
base_nw.mard <- function(nwstats) {
base_nw.msm <- function(nwstats) {

num.B <- nwstats$num.B
num.W <- nwstats$num.W
Expand Down
4 changes: 2 additions & 2 deletions R/mod.acts.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Module function for setting the number of sexual acts on the
#' discordant edgelist.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' The number of acts at each time step is specified as a function of the race of
Expand All @@ -22,7 +22,7 @@
#' @keywords module
#' @export
#'
acts.mard <- function(dat, at) {
acts.msm <- function(dat, at) {

for (type in c("main", "pers", "inst")) {

Expand Down
2 changes: 1 addition & 1 deletion R/mod.aging.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @keywords module
#' @export
#'
aging.mard <- function(dat, at) {
aging.msm <- function(dat, at) {

time.unit <- dat$param$time.unit

Expand Down
8 changes: 4 additions & 4 deletions R/mod.births.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Module function for births or entries into the sexually active
#' population.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' New population members are added based on expected numbers of entries among
Expand All @@ -21,7 +21,7 @@
#' @keywords module
#' @export
#'
births.mard <- function(dat, at){
births.msm <- function(dat, at){

## Variables

Expand All @@ -48,7 +48,7 @@ births.mard <- function(dat, at){

## Update Attr
if (nBirths > 0) {
dat <- setBirthAttr.mard(dat, at, nBirths.B, nBirths.W)
dat <- setBirthAttr.msm(dat, at, nBirths.B, nBirths.W)
}


Expand All @@ -67,7 +67,7 @@ births.mard <- function(dat, at){
}


setBirthAttr.mard <- function(dat, at, nBirths.B, nBirths.W) {
setBirthAttr.msm <- function(dat, at, nBirths.B, nBirths.W) {

nBirths <- nBirths.B + nBirths.W

Expand Down
4 changes: 2 additions & 2 deletions R/mod.condoms.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Module function stochastically simulates potential condom use
#' for each act on the discordant edgelist.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' For each act on the discordant edgelist, condom use is stochastically simulated
Expand All @@ -20,7 +20,7 @@
#' @keywords module
#' @export
#'
condoms.mard <- function(dat, at) {
condoms.msm <- function(dat, at) {

for (type in c("main", "pers", "inst")) {

Expand Down
6 changes: 3 additions & 3 deletions R/mod.death.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Module function for simulting both general and disease-related
#' deaths among population members.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' Deaths are divided into two categories: general deaths, for which demographic
Expand All @@ -19,13 +19,13 @@
#' This function returns the updated \code{dat} object accounting for deaths.
#' The deaths are deactivated from the main and casual networks, as those are in
#' \code{networkDynamic} class objects; dead nodes are not deleted from the
#' instant network until the \code{\link{simnet.mard}} module for bookkeeping
#' instant network until the \code{\link{simnet.msm}} module for bookkeeping
#' purposes.
#'
#' @keywords module
#' @export
#'
deaths.mard <- function(dat, at) {
deaths.msm <- function(dat, at) {

## General deaths
age <- floor(dat$attr$age)
Expand Down
4 changes: 2 additions & 2 deletions R/mod.disclose.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Module function for disclosure of HIV status to partners given
#' non-disclosure in the past.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' Persons who are infected may disclose their status to partners at three
Expand All @@ -20,7 +20,7 @@
#' @keywords module
#' @export
#'
disclose.mard <- function(dat, at){
disclose.msm <- function(dat, at){

for (type in c("main", "pers", "inst")) {

Expand Down
4 changes: 2 additions & 2 deletions R/mod.edgescorr.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Adjusts the edges coefficients in a dynamic network model
#' to preserve the mean degree.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' In HIV/STI modeling, there is typically an assumption that changes in
Expand All @@ -27,7 +27,7 @@
#' @keywords module
#' @export
#'
edges_correct.mard <- function(dat, at) {
edges_correct.msm <- function(dat, at) {

old.num <- dat$epi$num[at - 1]
new.num <- sum(dat$attr$active == 1, na.rm = TRUE)
Expand Down
18 changes: 9 additions & 9 deletions R/mod.init.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#' simulates disease status and other attributes.
#'
#' @param x An \code{EpiModel} object of class \code{\link{netest}}.
#' @param param An \code{EpiModel} object of class \code{\link{param.mard}}.
#' @param init An \code{EpiModel} object of class \code{\link{init.mard}}.
#' @param control An \code{EpiModel} object of class \code{\link{control.mard}}.
#' @param param An \code{EpiModel} object of class \code{\link{param.msm}}.
#' @param init An \code{EpiModel} object of class \code{\link{init.msm}}.
#' @param control An \code{EpiModel} object of class \code{\link{control.msm}}.
#' @param s Simulation number, used for restarting dependent simulations.
#'
#' @return
Expand All @@ -18,7 +18,7 @@
#' @export
#' @keywords module
#'
initialize.mard <- function(x, param, init, control, s) {
initialize.msm <- function(x, param, init, control, s) {

# Master data list
dat <- list()
Expand Down Expand Up @@ -146,7 +146,7 @@ initialize.mard <- function(x, param, init, control, s) {
dat$attr$ins.quot <- ins.quot

# HIV-related attributes
dat <- init_status.mard(dat)
dat <- init_status.msm(dat)

# CCR5
dat <- init_ccr5(dat)
Expand All @@ -161,7 +161,7 @@ initialize.mard <- function(x, param, init, control, s) {
dat$temp$discl.list <- matrix(NA, nrow = 0, ncol = 3)
colnames(dat$temp$discl.list) <- c("pos", "neg", "discl.time")

dat <- prevalence.mard(dat, at = 1)
dat <- prevalence.msm(dat, at = 1)

class(dat) <- "dat"
return(dat)
Expand Down Expand Up @@ -193,7 +193,7 @@ remove_bad_roles <- function(nw) {
}


init_status.mard <- function(dat) {
init_status.msm <- function(dat) {

num.B <- dat$init$num.B
num.W <- dat$init$num.W
Expand Down Expand Up @@ -675,7 +675,7 @@ init_ccr5 <- function(dat) {
#' specified time step given an input \code{netsim} object.
#'
#' @param x An \code{EpiModel} object of class \code{\link{netsim}}.
#' @inheritParams initialize.mard
#' @inheritParams initialize.msm
#'
#' @return
#' This function resets the data elements on the \code{dat} master data object
Expand All @@ -684,7 +684,7 @@ init_ccr5 <- function(dat) {
#' @export
#' @keywords module
#'
reinit.mard <- function(x, param, init, control, s) {
reinit.msm <- function(x, param, init, control, s) {

if (any(c("param", "control", "nwparam", "epi", "attr", "temp",
"riskh", "el", "p") %in% names(x)) == FALSE) {
Expand Down
4 changes: 2 additions & 2 deletions R/mod.position.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Module function for establishing sexual role or position in each
#' act on the discordant edgelist.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' The sexual role within each act is determined by each nodes "role identity"
Expand All @@ -22,7 +22,7 @@
#' @keywords module
#' @export
#'
position.mard <- function(dat, at) {
position.msm <- function(dat, at) {

## Variables
al <- dat$temp$al
Expand Down
4 changes: 2 additions & 2 deletions R/mod.prep.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#' @description Module function for implementation and uptake of pre-exposure
#' prophylaxis (PrEP) to prevent HIV infection.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @export
#'
prep.mard <- function(dat, at) {
prep.msm <- function(dat, at) {

if (at < dat$param$prep.start) {
return(dat)
Expand Down
6 changes: 3 additions & 3 deletions R/mod.prevalence.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description This module calculates demographic, transmission, and clinical
#' statistics at each time step within the simulation.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' Summary statistic calculations are of two broad forms: prevalence and
Expand All @@ -21,7 +21,7 @@
#' @keywords module
#' @export
#'
prevalence.mard <- function(dat, at) {
prevalence.msm <- function(dat, at) {

active <- dat$attr$active
race <- dat$attr$race
Expand Down Expand Up @@ -110,7 +110,7 @@ prevalence.mard <- function(dat, at) {
}


prev.full.mard <- function(dat, at) {
prev.full.msm <- function(dat, at) {

active <- dat$attr$active
race <- dat$attr$race
Expand Down
4 changes: 2 additions & 2 deletions R/mod.progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description Module function for HIV disease progression through acute, chronic
#' and AIDS stages.
#'
#' @inheritParams aging.mard
#' @inheritParams aging.msm
#'
#' @details
#' HIV disease is divided into four stages: acute rising, acute falling, chronic
Expand All @@ -30,7 +30,7 @@
#' @keywords module
#' @export
#'
progress.mard <- function(dat, at) {
progress.msm <- function(dat, at) {

## Variables

Expand Down
Loading

0 comments on commit 65e8d7d

Please sign in to comment.