Running ‘combine.networks.R’ [6s/14s]
  Running ‘degree.mean.age.R’
  Running ‘dynamic_EGMME.R’
  Running ‘dynamic_EGMME.simple.R’
  Running ‘dynamic_MLE.R’
  Running ‘dynamic_MLE_2.R’
  Running ‘dynamic_MLE_blockdiag.R’
  Running ‘dynamic_MLE_blockdiag.bipartite.R’
  Running ‘requireNamespaceTest.R’
  Running ‘sim_gf_sum.R’
  Running ‘simulate_networkDynamic.R’ [59s/146s]
  Running ‘tergm_offset_tests.R’
  Running ‘tergm_parallel.R’ [4s/10s]
Running the tests in ‘tests/dynamic_MLE.R’ failed.
Complete output:
  > #  File tests/dynamic_MLE.R in package tergm, part of the Statnet suite
  > #  of packages for network analysis, http://statnet.org .
  > #
  > #  This software is distributed under the GPL-3 license.  It is free,
  > #  open source, and has the attribution requirements (GPL Section 7) at
  > #  http://statnet.org/attribution
  > #
  > #  Copyright 2008-2017 Statnet Commons
  > #######################################################################
  > library(tergm)
  Loading required package: statnet.common
  
  Attaching package: 'statnet.common'
  
  The following object is masked from 'package:base':
  
      order
  
  Loading required package: ergm
  Loading required package: network
  network: Classes for Relational Data
  Version 1.13.0.1 created on 2015-08-31.
  copyright (c) 2005, Carter T. Butts, University of California-Irvine
                      Mark S. Handcock, University of California -- Los Angeles
                      David R. Hunter, Penn State University
                      Martina Morris, University of Washington
                      Skye Bender-deMoll, University of Washington
   For citation information, type citation("network").
   Type help("network-package") to get started.
  
  
  ergm: version 3.9.4, created on 2018-08-15
  Copyright (c) 2018, Mark S. Handcock, University of California -- Los Angeles
                      David R. Hunter, Penn State University
                      Carter T. Butts, University of California -- Irvine
                      Steven M. Goodreau, University of Washington
                      Pavel N. Krivitsky, University of Wollongong
                      Martina Morris, University of Washington
                      with contributions from
                      Li Wang
                      Kirk Li, University of Washington
                      Skye Bender-deMoll, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("ergm").
  
  NOTE: Versions before 3.6.1 had a bug in the implementation of the bd()
  constriant which distorted the sampled distribution somewhat. In
  addition, Sampson's Monks datasets had mislabeled vertices. See the
  NEWS and the documentation for more details.
  
  
  Attaching package: 'ergm'
  
  The following objects are masked from 'package:statnet.common':
  
      colMeans.mcmc.list, sweep.mcmc.list
  
  Loading required package: networkDynamic
  
  networkDynamic: version 0.9.0, created on 2016-01-12
  Copyright (c) 2016, Carter T. Butts, University of California -- Irvine
                      Ayn Leslie-Cook, University of Washington
                      Pavel N. Krivitsky, University of Wollongong
                      Skye Bender-deMoll, University of Washington
                      with contributions from
                      Zack Almquist, University of California -- Irvine
                      David R. Hunter, Penn State University
                      Li Wang
                      Kirk Li, University of Washington
                      Steven M. Goodreau, University of Washington
                      Jeffrey Horner
                      Martina Morris, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("networkDynamic").
  
  
  tergm: version 3.4.1, created on 2017-09-12
  Copyright (c) 2017, Pavel N. Krivitsky, University of Wollongong
                      Mark S. Handcock, University of California -- Los Angeles
                      with contributions from
                      David R. Hunter, Penn State University
                      Steven M. Goodreau, University of Washington
                      Martina Morris, University of Washington
                      Nicole Bohme Carnegie, New York University
                      Carter T. Butts, University of California -- Irvine
                      Ayn Leslie-Cook, University of Washington
                      Skye Bender-deMoll
                      Li Wang
                      Kirk Li, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("tergm").
  
  Warning messages:
  1: replacing previous import 'statnet.common::sweep.mcmc.list' by 'ergm::sweep.mcmc.list' when loading 'tergm' 
  2: replacing previous import 'statnet.common::colMeans.mcmc.list' by 'ergm::colMeans.mcmc.list' when loading 'tergm' 
  3: 'ergm.MHP.table' is deprecated.
  See help("Deprecated") 
  4: Function ergm.ConstraintImplications() has been deprecated in favor of specifying the implications in the InitErgmConstraint.*() functions, and has no effect. 
  > 
  > tolerance<-0.05
  > n<-10
  > m<-6
  > theta<--1.5
  > 
  > logit<-function(p) log(p/(1-p))
  > 
  > form.mle<-function(y0,y1){
  +   logit(network.edgecount(y1-y0,na.omit=TRUE)/(network.dyadcount(y1)-network.edgecount(y0-is.na(y1))))
  + }
  > 
  > diss.mle<-function(y0,y1){
  +   -logit(network.edgecount(y0-y1,na.omit=TRUE)/(network.edgecount(y0-is.na(y1))))
  + }
  > 
  > do.run <- function(dir, bip=FALSE, prop.weights="default"){
  + if(bip){ # Extreme theta creates networks with too few ties to properly test.
  +   theta <- theta/2
  + }
  +   
  + y0<-network.initialize(n,dir=dir,bipartite=bip)
  + set.seed(321)
  + y0<-standardize.network(simulate(y0~edges, coef=theta, control=control.simulate(MCMC.burnin=n^2*2)))
  + 
  + cat("Complete data:\n")
  + 
  + set.seed(123)
  + y1<-standardize.network(simulate(y0~edges, coef=theta, control=control.simulate(MCMC.burnin=n^2*2)))
  + 
  + # Force CMPLE
  + set.seed(543)
  + fit<-stergm(list(y0,y1), formation=~edges, dissolution=~edges, estimate="CMPLE", times=c(1,2))
  + 
  + stopifnot(fit$estimate=="CMPLE", fit$formation.fit$estimate=="MPLE", fit$dissolution.fit$estimate=="MPLE")
  + stopifnot(all.equal(form.mle(y0,y1), coef(fit$formation.fit), tolerance=tolerance, check.attributes=FALSE))
  + stopifnot(all.equal(diss.mle(y0,y1), coef(fit$dissolution.fit), tolerance=tolerance, check.attributes=FALSE))
  + 
  + # Autodetected CMPLE
  + set.seed(543)
  + fit<-stergm(list(y0,y1), formation=~edges, dissolution=~edges, estimate="CMLE", times=c(1,2))
  + 
  + stopifnot(fit$estimate=="CMLE", is.null(fit$formation.fit$sample), is.null(fit$dissolution.fit$sample))
  + stopifnot(all.equal(form.mle(y0,y1), coef(fit$formation.fit), tolerance=tolerance, check.attributes=FALSE))
  + stopifnot(all.equal(diss.mle(y0,y1), coef(fit$dissolution.fit), tolerance=tolerance, check.attributes=FALSE))
  + 
  + # Force CMLE
  + for(prop.weight in prop.weights){
  + cat("====",prop.weight,"====\n")
  + set.seed(543)
  + fit<-stergm(list(y0,y1), formation=~edges, dissolution=~edges, estimate="CMLE", control=control.stergm(CMLE.control=control.ergm(force.main=TRUE, MCMC.prop.weights=prop.weight)), times=c(1,2))
  + 
  + stopifnot(fit$estimate=="CMLE", fit$formation.fit$estimate=="MLE", fit$dissolution.fit$estimate=="MLE")
  + stopifnot(all.equal(form.mle(y0,y1), coef(fit$formation.fit), tolerance=tolerance, check.attributes=FALSE))
  + stopifnot(all.equal(diss.mle(y0,y1), coef(fit$dissolution.fit), tolerance=tolerance, check.attributes=FALSE))
  + }
  + 
  + cat("Missing data:\n")
  + 
  + y1m<-network.copy(y1)
  + set.seed(765)
  + e <- as.edgelist(y1)[1,]
  + y1m[e[1], e[2]] <- NA
  + y1m[1,m+1] <- NA
  + 
  + # Force CMPLE
  + set.seed(765)
  + fit<-stergm(list(y0,y1m), formation=~edges, dissolution=~edges, estimate="CMPLE", times=c(1,2))
  + 
  + stopifnot(fit$estimate=="CMPLE", fit$formation.fit$estimate=="MPLE", fit$dissolution.fit$estimate=="MPLE")
  + stopifnot(all.equal(form.mle(y0,y1m), coef(fit$formation.fit), tolerance=tolerance, check.attributes=FALSE))
  + stopifnot(all.equal(diss.mle(y0,y1m), coef(fit$dissolution.fit), tolerance=tolerance, check.attributes=FALSE))
  + 
  + # Autodetected CMPLE
  + set.seed(765)
  + fit<-stergm(list(y0,y1m), formation=~edges, dissolution=~edges, estimate="CMLE", times=c(1,2))
  + 
  + stopifnot(fit$estimate=="CMLE", is.null(fit$formation.fit$sample), is.null(fit$dissolution.fit$sample))
  + stopifnot(all.equal(form.mle(y0,y1m), coef(fit$formation.fit), tolerance=tolerance, check.attributes=FALSE))
  + stopifnot(all.equal(diss.mle(y0,y1m), coef(fit$dissolution.fit), tolerance=tolerance, check.attributes=FALSE))
  + 
  + # Force CMLE
  + for(prop.weight in prop.weights){
  + cat("====",prop.weight,"====\n")
  + set.seed(234)
  + fit<-stergm(list(y0,y1m), formation=~edges, dissolution=~edges, estimate="CMLE", control=control.stergm(CMLE.control=control.ergm(force.main=TRUE, MCMC.prop.weights=prop.weight)), times=c(1,2))
  + 
  + stopifnot(fit$estimate=="CMLE", fit$formation.fit$estimate=="MLE", fit$dissolution.fit$estimate=="MLE")
  + stopifnot(all.equal(form.mle(y0,y1m), coef(fit$formation.fit), tolerance=tolerance, check.attributes=FALSE))
  + stopifnot(all.equal(diss.mle(y0,y1m), coef(fit$dissolution.fit), tolerance=tolerance, check.attributes=FALSE))
  + }
  + }
  > 
  > cat("=========== Directed test ===========\n")
  =========== Directed test ===========
  > do.run(TRUE, prop.weights=c("default","random"))
  Complete data:
  Fitting formation...
  Error: Formation constraint ``atleast'' requires a baseline network.
  In addition: Warning messages:
  1: 'ergm.update.formula' is deprecated.
  See help("Deprecated") 
  2: 'ergm.getmodel' is deprecated.
  See help("Deprecated") 
  3: InitConstraint convention has been replaced by InitErgmConstraint. 
  Execution halted
Running the tests in ‘tests/sim_gf_sum.R’ failed.
Complete output:
  > #  File tests/sim_gf_sum.R in package tergm, part of the Statnet suite
  > #  of packages for network analysis, http://statnet.org .
  > #
  > #  This software is distributed under the GPL-3 license.  It is free,
  > #  open source, and has the attribution requirements (GPL Section 7) at
  > #  http://statnet.org/attribution
  > #
  > #  Copyright 2008-2017 Statnet Commons
  > #######################################################################
  > library(tergm)
  Loading required package: statnet.common
  
  Attaching package: 'statnet.common'
  
  The following object is masked from 'package:base':
  
      order
  
  Loading required package: ergm
  Loading required package: network
  network: Classes for Relational Data
  Version 1.13.0.1 created on 2015-08-31.
  copyright (c) 2005, Carter T. Butts, University of California-Irvine
                      Mark S. Handcock, University of California -- Los Angeles
                      David R. Hunter, Penn State University
                      Martina Morris, University of Washington
                      Skye Bender-deMoll, University of Washington
   For citation information, type citation("network").
   Type help("network-package") to get started.
  
  
  ergm: version 3.9.4, created on 2018-08-15
  Copyright (c) 2018, Mark S. Handcock, University of California -- Los Angeles
                      David R. Hunter, Penn State University
                      Carter T. Butts, University of California -- Irvine
                      Steven M. Goodreau, University of Washington
                      Pavel N. Krivitsky, University of Wollongong
                      Martina Morris, University of Washington
                      with contributions from
                      Li Wang
                      Kirk Li, University of Washington
                      Skye Bender-deMoll, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("ergm").
  
  NOTE: Versions before 3.6.1 had a bug in the implementation of the bd()
  constriant which distorted the sampled distribution somewhat. In
  addition, Sampson's Monks datasets had mislabeled vertices. See the
  NEWS and the documentation for more details.
  
  
  Attaching package: 'ergm'
  
  The following objects are masked from 'package:statnet.common':
  
      colMeans.mcmc.list, sweep.mcmc.list
  
  Loading required package: networkDynamic
  
  networkDynamic: version 0.9.0, created on 2016-01-12
  Copyright (c) 2016, Carter T. Butts, University of California -- Irvine
                      Ayn Leslie-Cook, University of Washington
                      Pavel N. Krivitsky, University of Wollongong
                      Skye Bender-deMoll, University of Washington
                      with contributions from
                      Zack Almquist, University of California -- Irvine
                      David R. Hunter, Penn State University
                      Li Wang
                      Kirk Li, University of Washington
                      Steven M. Goodreau, University of Washington
                      Jeffrey Horner
                      Martina Morris, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("networkDynamic").
  
  
  tergm: version 3.4.1, created on 2017-09-12
  Copyright (c) 2017, Pavel N. Krivitsky, University of Wollongong
                      Mark S. Handcock, University of California -- Los Angeles
                      with contributions from
                      David R. Hunter, Penn State University
                      Steven M. Goodreau, University of Washington
                      Martina Morris, University of Washington
                      Nicole Bohme Carnegie, New York University
                      Carter T. Butts, University of California -- Irvine
                      Ayn Leslie-Cook, University of Washington
                      Skye Bender-deMoll
                      Li Wang
                      Kirk Li, University of Washington
  Based on "statnet" project software (statnet.org).
  For license and citation information see statnet.org/attribution
  or type citation("tergm").
  
  Warning messages:
  1: replacing previous import 'statnet.common::sweep.mcmc.list' by 'ergm::sweep.mcmc.list' when loading 'tergm' 
  2: replacing previous import 'statnet.common::colMeans.mcmc.list' by 'ergm::colMeans.mcmc.list' when loading 'tergm' 
  3: 'ergm.MHP.table' is deprecated.
  See help("Deprecated") 
  4: Function ergm.ConstraintImplications() has been deprecated in favor of specifying the implications in the InitErgmConstraint.*() functions, and has no effect. 
  > 
  > logit<-function(p)log(p/(1-p))
  > 
  > coef.form.f<-function(coef.diss,density) -log(((1+exp(coef.diss))/(density/(1-density)))-1)
  > 
  > simtest <- function(S, edges, dur, n, dir=FALSE, bip=0){
  +   m <- if(bip) bip else n
  +   
  +   target.stats<-edges
  +   coef.diss<-logit(1-1/dur)
  +   
  +   dc <- matrix(rnorm(n*m),n,m)
  +   if(!dir && !bip) dc <- dc+t(dc)
  +   # Note that if nw1!=nw2, then
  +   # summary(nw1~edgecov(dc)+edgecov.ages(dc))!=summary(nw2~edgecov(dc)+edgecov.ages(dc))
  +   # with probability 1. Thus, they offer a sort of a checksum of a network.
  +   
  +   g0<-network.initialize(n, dir=dir, bipartite=bip)
  +   g0 %n% "dc" <- dc
  +   g0 %n% "time" <- 0
  +   g0 %n% "lasttoggle" <- -1-rgeom(network.dyadcount(g0),1/4)
  + 
  + 
  +   
  +   dyads <- network.dyadcount(g0)
  +   density<-edges/dyads
  +   
  +   coef.form<-coef.form.f(coef.diss,density)
  +   
  +   # Get a reasonably close starting network.
  +   g1<-san(g0~edges,target.stats=target.stats,verbose=TRUE)
  +   
  +   print(coef.form)
  +   print(coef.diss)
  +   
  +   # Simulate. Starting from an ordinary network:
  +   dynsim<-simulate(g1,formation=~edges,dissolution=~edges,coef.form=coef.form,coef.diss=coef.diss,time.slices=S,verbose=TRUE,monitor=~edgecov("dc")+edgecov.ages("dc"))
  +   
  +   # Resuming from a networkDynamic:
  +   dynsim2<-simulate(dynsim,formation=~edges,dissolution=~edges,coef.form=coef.form,coef.diss=coef.diss,time.slices=S,verbose=TRUE,monitor=~edgecov("dc")+edgecov.ages("dc"))
  +   
  +   # Resuming from a resumed networkDynamic:
  +   dynsim3<-simulate(dynsim2,formation=~edges,dissolution=~edges,coef.form=coef.form,coef.diss=coef.diss,time.slices=S,verbose=TRUE,monitor=~edgecov("dc")+edgecov.ages("dc"))
  + 
  +   sim.stats <- attr(dynsim3,"stats")
  +   
  +   # Replay the simulation using a networkDynamic:
  +   gf1.stats <- as.matrix(tergm.godfather(dynsim3~edgecov("dc")+edgecov.ages("dc"), start=0, end=S*3))
  +   
  +   # Replay the sim using networkDynamic with no explicit time params (should be using net.obs.period)
  +   gf1b.stats <- as.matrix(tergm.godfather(dynsim3~edgecov("dc")+edgecov.ages("dc")))
  +   
  +   # Replay the simulation using a network + list of changes:
  +   gf2.stats <- as.matrix(tergm.godfather(g1~edgecov("dc")+edgecov.ages("dc"), start=0, end=S*3, changes=attr(dynsim3,"changes")))
  +   
  +   # Evaluate summary statistics directly:
  +   summ.stats <- summary(dynsim3~edgecov("dc")+edgecov.ages("dc"), at=1:(S*3))
  +   
  +   # If they aren't all identical, we are in trouble.
  +   stopifnot(all.equal(sim.stats,gf1.stats),
  +             all.equal(sim.stats,gf1b.stats),
  +             all.equal(sim.stats,gf2.stats),
  +             all.equal(sim.stats,summ.stats))
  + }
  > 
  > set.seed(1)
  > cat("Undirected, unipartite:\n")
  Undirected, unipartite:
  > simtest(20, 10, 10, 10, FALSE, FALSE)
  Starting 1 MCMC iteration of 1e+05 steps.
  #1 of 1: Returned from SAN Metropolis-Hastings burnin
  SAN Metropolis-Hastings accepted   0.010% of 100000 proposed steps.
  [1] -3.526361
  [1] 2.197225
  Returned from STERGM burnin
  extracting state of networkDynamic at time  20 
  Returned from STERGM burnin
  Updating networkDynamic with simulated time: ( 21 41 ).
  extracting state of networkDynamic at time  40 
  Returned from STERGM burnin
  Updating networkDynamic with simulated time: ( 41 61 ).
  Error in simtest(20, 10, 10, 10, FALSE, FALSE) : 
    sim.stats and summ.stats are not equal:
    Lengths: 120, 2
    names for current but not for target
    Attributes: < names for target but not for current >
    ....
  Calls: simtest -> stopifnot
  In addition: Warning messages:
  1: 'ergm.update.formula' is deprecated.
  See help("Deprecated") 
  2: 'ergm.getmodel' is deprecated.
  See help("Deprecated") 
  3: 'coef.length.model' is deprecated.
  See help("Deprecated") 
  4: 'MHproposal' is deprecated.
  See help("Deprecated") 
  5: InitWtMHP and InitMHP convention has been replaced by InitWtErgm and InitErgm, respectively. 
  6: 'summary.statistics.network' is deprecated.
  See help("Deprecated") 
  Execution halted