Running ‘constrain_degrees_edges.R’
  Running ‘drop_tests.R’
  Running ‘ergm_term_doc_test.R’
  Running ‘gw_sp_tests.R’ [17s/17s]
  Running ‘hamming_termtests.R’
  Running ‘miss_tests.CD.R’
  Running ‘miss_tests.R’
  Running ‘mple_largenetwork.R’
  Running ‘mple_offset.R’
  Running ‘nodrop.R’
  Running ‘parallel.R’
  Running ‘requireNamespaceTest.R’
  Running ‘runtime_diags.R’
  Running ‘simpletests.R’
  Running ‘steppingtest.R’
  Running ‘termTests.b12nodematch.R’
  Running ‘termTests.bipartite.R’ [13s/13s]
  Running ‘termTests.directed.R’
  Running ‘termTests.flexible.R’ [12s/13s]
  Running ‘termTests.undirected.R’
  Running ‘termTests.valued.R’ [40s/41s]
  Running ‘testgflomiss.R’
  Running ‘testgmonkmiss.R’
  Running ‘testthat.R’ [139s/145s]
  Running ‘u_function.R’
  Running ‘valued_sim.R’
Running the tests in ‘tests/termTests.directed.R’ failed.
Complete output:
  > #  File tests/termTests.directed.R in package ergm, part of the
  > #  Statnet suite of packages for network analysis, https://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
  > #  https://statnet.org/attribution .
  > #
  > #  Copyright 2003-2021 Statnet Commons
  > ################################################################################
  > 
  > library(ergm)
  Loading required package: network
  
  'network' 1.17.1 (2021-06-12), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  
  'ergm' 4.1.2 (2021-07-26), part of the Statnet Project
  * 'news(package="ergm")' for changes since last version
  * 'citation("ergm")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  'ergm' 4 is a major update that introduces some backwards-incompatible
  changes. Please type 'news(package="ergm")' for a list of major
  changes.
  
  > 
  > # a directed nw
  > load("sampson.wrong.RData") # Old (wrong) version of sampson's monks
  > set.seed(42)
  > set.edge.attribute(samplike, "YearsTrusted", rbinom(88, 4, .5))
  > set.seed(296)
  > set.vertex.attribute(samplike, "YearsServed", rbinom(18, 10, .5))
  > samplike %v% "Trinity" <- c("F", "S", "H")
  > 
  > num.passed.tests=0
  > num.tests=0
  > 
  > 
  > #asymmetric, directed
  > num.tests=num.tests + 1
  > s.0 <- summary(samplike~asymmetric)
  > e.0 <- ergm(samplike~asymmetric, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.a <- summary(samplike~asymmetric("group"))
  > e.a <- ergm(samplike~asymmetric("group"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ad <- summary(samplike~asymmetric(function(x) x %v% "group", diff=TRUE))
  > e.ad <- ergm(samplike~asymmetric(~group, diff=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ak <- summary(samplike~asymmetric("group", levels=3))
  > e.ak <- ergm(samplike~asymmetric(function(x) x %v% "group", levels=3), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.adk <- summary(samplike~asymmetric(~group, diff=TRUE, keep=1:2))
  In term 'asymmetric' in package 'ergm': Argument 'keep' has been superseded by 'levels', and it is recommended to use the latter.  Note that its interpretation may be different.
  > e.adk <- ergm(samplike~asymmetric("group", diff=TRUE, keep=c(1,3)), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 32 || round(coef(e.0)+1.33,3)!=0 ||
  +     s.a != 17 || round(coef(e.a)+.6008,3)!=0  ||
  +     !all(s.ad==c(7,2,8)) ||
  +     !all(round(coef(e.ad)+c(.6931, .6931, .4855),3)==0) ||
  +     s.ak!=8 || round(coef(e.ak)+.4855,3)!=0 ||
  +     !all(s.adk==c(7,2)) ||
  +     !all(round(coef(e.adk)+c(.6931, .4855),3)==0)) {
  +  print(list(s.0=s.0, e.0=e.0, s.a=s.a, e.a=e.a, s.ad=s.ad, e.ad=e.ad, s.ak=s.ak,
  +             e.ak=e.ak, s.adk=s.adk, e.adk=e.adk))
  +  stop("Failed asymmetric term test")
  + } else {
  +  print("Passed asymmetric term test")
  +  num.passed.tests=num.passed.tests+1
  + }
  [1] "Passed asymmetric term test"
  > 
  > 
  > 
  > 
  > # ctripe=ctriad, directed
  > num.tests=num.tests + 1
  > s.0 <- summary(samplike~ctriple)
  > e.0 <- ergm(samplike~ctriad, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.a <- summary(samplike~ctriple(function(x) x %v% "group"))
  > e.a <- ergm(samplike~ctriple("group"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ad <- summary(samplike~ctriad(~group, diff=TRUE))
  > e.ad <- ergm(samplike~ctriple(function(x) x %v% "group", diff=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 39 || round(coef(e.0) + .3522, 3) != 0 ||
  +     s.a != 34 || round(coef(e.a) - .1217, 3) != 0 ||
  +     !all(s.ad==c(8,4,22)) ||
  +     !all(round(coef(e.ad)+c(.1949, -.6931, -.2023),3)==0)) {
  +  print(list(s.0=s.0, e.0=e.0, s.a=s.a, e.a=e.a, s.ad=s.ad, e.ad=e.ad))
  +  stop("Failed ctriple term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed ctriple term test")
  + }
  [1] "Passed ctriple term test"
  > 
  > 
  > 
  > # cyclicalties, directed
  > num.tests=num.tests+1
  > s.0 <- summary(samplike~cyclicalties)
  > e.0 <- ergm(samplike~cyclicalties, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.b <- summary(samplike~cyclicalties(attr=function(x) x %v% "group"))
  > e.b <- ergm(samplike~cyclicalties(attr="group"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 62 || round(coef(e.0) + 0.4154, 3) != 0 ||
  + 		!all(s.b==55) ||
  + 		!all(round(coef(e.b) - 0.2289 , 3) == 0)) {
  + 	print(list(s.0=s.0, e.0=e.0, s.b=s.b, e.b=e.b))
  + 	stop("Failed cyclicalties term test")
  + } else {
  + 	num.passed.tests = num.passed.tests+1
  + 	print("Passed cyclicalties term test")
  + }
  [1] "Passed cyclicalties term test"
  > 
  > 
  > 
  > # idegrange, directed
  > num.tests=num.tests + 1
  > s.0 <- summary(samplike~idegrange(5:8))
  > e.0 <- ergm(samplike~idegrange(5:8), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.h <- summary(samplike~idegrange(5:8, by="group", homophily=TRUE))
  > e.h <- ergm(samplike~idegrange(5:8, by=~group, homophily=TRUE), estimate="MPLE")
  Observed statistic(s) ideg7+.homophily.group and ideg8+.homophily.group are at their smallest attainable values. Their coefficients will be fixed at -Inf.
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (!all(s.0==c(9, 6, 4, 3)) || round(coef(e.0) + c(-0.1431, 1.0986, 1.1451, 0.2231 ))!= 0 ||!all(s.h==c(5, 3, 0, 0)) || round(coef(e.h) + c(-0.5108, -2.1972 , Inf, Inf ))!= 0) {
  + 	print(list(s.0=s.0, e.0=e.0, s.h=s.h, e.h=e.h))
  + 	stop("Failed idegrange term test")
  + } else {
  + 	print("Passed idegrange term test")
  + 	num.passed.tests = num.passed.tests+1
  + }
  Error in !all(s.0 == c(9, 6, 4, 3)) || round(coef(e.0) + c(-0.1431, 1.0986,  : 
    'length = 4' in coercion to 'logical(1)'
  Execution halted
Running the tests in ‘tests/termTests.flexible.R’ failed.
Complete output:
  > #  File tests/termTests.flexible.R in package ergm, part of the
  > #  Statnet suite of packages for network analysis, https://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
  > #  https://statnet.org/attribution .
  > #
  > #  Copyright 2003-2021 Statnet Commons
  > ################################################################################
  > 
  > library(ergm)
  Loading required package: network
  
  'network' 1.17.1 (2021-06-12), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  
  'ergm' 4.1.2 (2021-07-26), part of the Statnet Project
  * 'news(package="ergm")' for changes since last version
  * 'citation("ergm")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  'ergm' 4 is a major update that introduces some backwards-incompatible
  changes. Please type 'news(package="ergm")' for a list of major
  changes.
  
  > 
  > # a bipartite nw
  > set.seed(143)
  > b1 <- floor(runif(60, 1,100))
  > b2 <- floor(runif(60, 101, 130))
  > exbip.el <- cbind(b1,b2)
  > bipnw <- as.network(exbip.el, matrix.type="edgelist", bipartite=100, directed=FALSE)
  > bipnw %v% "Letter" <- letters[1:3]
  > bipnw %v% "Cost" <- c(3,2,1)
  >                           
  > 
  > # another bipartite nw with more ties and 2 attributes
  > set.seed(258)
  > b1 <- floor(runif(150, 1,200))
  > b2 <- floor(runif(150, 201, 400))
  > exbip.el <- cbind(b1,b2)
  > bipnw2 <- as.network(exbip.el, matrix.type="edgelist", bipartite=100, directed=FALSE)
  > bipnw2 %v% "Letter" <- letters[1:2]
  > color <- rbinom(400, 1, .4)
  > color[color ==1] <- "Purple"
  > color[color ==0] <- "Gold"
  > bipnw2 %v% "Color" <- color
  > 
  > 
  > # a directed nw
  > load("sampson.wrong.RData") # Old (wrong) version of sampson's monks
  > set.seed(42)
  > set.edge.attribute(samplike, "YearsTrusted", rbinom(88, 4, .5))
  > set.seed(296)
  > set.vertex.attribute(samplike, "YearsServed", rbinom(18, 10, .5))
  > samplike %v% "Trinity" <- c("F", "S", "H")
  > 
  > 
  > # an undirected nw
  > data(faux.mesa.high)
  > fmh <- faux.mesa.high
  > set.seed(7)
  > set.edge.attribute(fmh, "GradeMet", rbinom(203, 6, .5))
  > 
  > 
  > # a small undirected nw w/ lots o' triangles
  > set.seed(20)
  > t<-trunc(runif(160, 1, 20))
  > set.seed(21)
  > h<-trunc(runif(160, 1, 20))
  > el <- cbind(t,h)
  > bad <- which(el[,2]==el[,1])
  > el[bad,2] = el[bad,2]+1
  > unnw <- network(el, directed=FALSE)
  > unnw %v% "Pet" <- c("dog", "cat")
  > 
  > 
  > num.passed.tests=0
  > num.tests=0
  > 
  > # absdiff, no required type, independent
  > num.tests=num.tests+1
  > s.a <- summary(fmh ~ absdiff("Grade"))
  > e.a <- ergm(fmh ~ absdiff(function(x) x %v% "Grade"))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ap <- summary(fmh ~ absdiff(~Grade, pow=2))
  > e.ap <- ergm(fmh ~ absdiff("Grade", pow=2))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Warning message:
  In ergm.mple(nw, fd, m, MPLEtype = MPLEtype, init = init, control = control,  :
    glm.fit: fitted probabilities numerically 0 or 1 occurred
  > 
  > if (s.a-79 != 0 || round(coef(e.a) + 4.354,3) != 0 ||
  +     s.ap-195 != 0 || round(coef(e.ap) + 3.41,3) != 0) {
  +  print(list(s.a=s.a,e.a=e.a, s.ap=s.ap, e.ap=e.ap))
  +  stop("Failed absdiff term test")
  + }else{
  +  num.passed.tests=num.passed.tests+1
  +  print("Passed absdiff term test")
  + }
  [1] "Passed absdiff term test"
  > 
  > 
  > # absdiffcat, no required type, independent
  > num.tests=num.tests+1
  > s.a <- summary(fmh ~ absdiffcat("Grade"))
  > e.a <- ergm(fmh ~ absdiffcat("Grade"))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ab <- summary(fmh ~ absdiffcat(function(x) x %v% "Grade", levels=-(4:5)))
  > e.ab <- ergm(fmh ~ absdiffcat(~Grade, base=(4:5)))
  In term 'absdiffcat' in package 'ergm': Argument 'base' has been superseded by 'levels', and it is recommended to use the latter.  Note that its interpretation may be different.
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (!all(s.a==c(15,15,7,2,1)) ||
  +     !all(round(coef(e.a)+c(6.005,5.788,6.063,6.891,6.611),3)==0) ||
  +     !all(s.ab==c(15,15,7)) ||
  +     !all(round(coef(e.ab)+c(6.005,5.788,6.063),3)==0)) {
  +  print(list(s.a=s.a,e.a=e.a, s.ab=s.ab, e.ab=e.ab))
  +  stop("Failed absdiffcat term test")
  + } else {
  +  num.passed.tests=num.passed.tests+1
  +  print("Passed absdiffcat term test")
  + }
  [1] "Passed absdiffcat term test"
  > 
  > 
  > 
  > # balance, dir or undir
  > num.tests=num.tests+1
  > s.0 <- summary(fmh~balance)
  > e.0 <- ergm(fmh~balance, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 40139 || round(coef(e.0) + .02376, 3) != 0) {
  +  print(list(s.0=s.0, e.0=e.0))
  +  stop("Failed balance term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed balance term test")
  + }
  [1] "Passed balance term test"
  > 
  > 
  > 
  > # cycle, either
  > num.tests=num.tests+1
  > s.0 <- summary(samplike ~ cycle(2:6))
  > e.0 <- ergm(samplike ~ cycle(2:6), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.1 <- summary(samplike ~ cycle(3:7,semi=TRUE))
  > e.1 <- ergm(samplike ~ cycle(3:7,semi=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.k <- summary(fmh~cycle(3:6))
  > e.k <- ergm(fmh~cycle(c(4,6)), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if(!all(s.0 == c(28, 39, 111, 260, 651)) ||
  +    !all(round(coef(e.0), 3) == c(2.118, -0.539, 0.410, -0.022, -0.049)) || 
  +    !all(s.1 == c(57, 216, 787, 2908, 10508)) ||
  +    !all(round(coef(e.1), 3) == c(-0.009, 0.144, 0.070, -0.031, 0.001)) || 
  +    !all(s.k==c(62,80,138,270)) ||
  +    !all(round(coef(e.k)+c(-.1615, .2083),3)==0)) {
  +  print(list(s.0=s.0, e.0=e.0, s.1=s.1, e.1=e.1, s.k=s.k, e.k=e.k))
  +  stop("Failed cycle test")
  + } else {
  +  num.passed.tests=num.passed.tests+1
  +  print("Passed cycle test")
  + }
  [1] "Passed cycle test"
  > 
  > 
  > 
  > # density, either
  > num.tests=num.tests+1
  > s.0 <- summary(fmh~density)
  > e.0 <- ergm(samplike~density, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (round(s.0 - .009708274,3) != 0 ||
  +     round(coef(e.0) + 277.5904, 3) != 0) {
  +  print(list(s.0=s.0, e.0=e.0))
  +  stop("Failed density term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed density term test")
  + }
  [1] "Passed density term test"
  > 
  > # diff, no required type but primarily directed, independent
  > num.tests=num.tests+1
  > # Auxiliary variables, useful for calculating the true values of statistics.
  > sthd <- outer(samplike%v%"YearsServed",samplike%v%"YearsServed","-") # YS[t]-YS[h]
  > sm <- as.matrix(samplike)
  > s.a <- summary(samplike ~ diff("YearsServed"))
  > e.a <- ergm(samplike ~ diff(~YearsServed))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ad <- summary(samplike ~ diff("YearsServed", dir="h-t"))
  > e.ad <- ergm(samplike ~ diff(function(x) x %v% "YearsServed", dir="h-t"))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ads2 <- summary(samplike ~ diff(~YearsServed, sign.action="abs"))
  > e.ads2 <- ergm(samplike ~ diff("YearsServed", sign.action="abs"))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ads3 <- summary(samplike ~ diff(~YearsServed, sign.action="pos"))
  > e.ads3 <- ergm(samplike ~ diff("YearsServed", sign.action="pos"))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ads4 <- summary(samplike ~ diff(function(x) x %v% "YearsServed", sign.action="neg"))
  > e.ads4 <- ergm(samplike ~ diff("YearsServed", sign.action="neg"))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ap <- summary(samplike ~ diff(function(x) x %v% "YearsServed", pow=3))
  > e.ap <- ergm(samplike ~ diff("YearsServed", pow=3))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > 
  > if (s.a!=sum(sthd*sm) || round(coef(e.a),3)!=0.063 ||
  +     s.ad!=sum(-sthd*sm) || round(coef(e.ad),3)!=-0.063 ||
  +     s.ads2!=sum(abs(sthd)*sm) || round(coef(e.ads2),3)!=-0.381 ||
  +     s.ads3!=sum((sthd+abs(sthd))*sm/2) || round(coef(e.ads3),3)!=-0.284 ||
  +     s.ads4!=sum((sthd-abs(sthd))*sm/2) || round(coef(e.ads4),3)!=0.504 ||
  +     s.ap!=sum(sthd^3*sm) || round(coef(e.ap),5)!=0.00184) {
  +   print(list(s.a=s.a,e.a=e.a, s.ad=s.ad, e.ad=e.ad,
  +              s.ads2=s.ads2, e.ads2=e.ads2,
  +              s.ads3=s.ads3, e.ads3=e.ads3,
  +              s.ads4=s.ads4, e.ads4=e.ads4,             
  +              s.ap=s.ap, e.ap=e.ap))
  +  stop("Failed diff term test")
  + }else{
  +  num.passed.tests=num.passed.tests+1
  +  print("Passed diff term test")
  + }
  [1] "Passed diff term test"
  > 
  > 
  > 
  > # dyadcov, either
  > num.tests=num.tests+1
  > set.seed(120)
  > cov <- matrix(rbinom(324, 1, .5),18,18)
  > cov <- cov+t(cov)
  > s.x <- summary(samplike~dyadcov(cov))
  > e.x <- ergm(samplike ~ dyadcov(cov))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.xa <- summary(fmh~dyadcov(fmh, "GradeMet"))
  > e.xa <- ergm(fmh ~ dyadcov(fmh, "GradeMet"))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Warning messages:
  1: In mple.existence(pl) : The MPLE does not exist!
  2: In ergm.mple(nw, fd, m, MPLEtype = MPLEtype, init = init, control = control,  :
    glm.fit: fitted probabilities numerically 0 or 1 occurred
  > if (!all(s.x==c(31,21,14)) ||
  +     !all(round(coef(e.x)+c(.8546, 1.0732, 1.3467),3)==0) ||
  +     s.xa!=641 || round(coef(e.xa) - 12.31787,3)!=0) {
  +  print(list(s.x=s.x,e.x=e.x,s.xa=s.xa,e.xa=e.xa))
  +  stop("Failed dyadcov test")
  + }else{
  +  num.passed.tests=num.passed.tests+1
  +  print("Passed dyadcov test")
  + }
  [1] "Passed dyadcov test"
  > 
  >   
  > 
  > # edgecov, either
  > num.tests=num.tests+1
  > set.seed(64)
  > cov <- matrix(rbinom(324, 3, .5),18,18)
  > s.x <- summary(samplike~edgecov(cov))
  > e.x <- ergm(samplike ~ edgecov(cov))
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.xa <- summary(samplike~edgecov(samplike, "YearsTrusted"))
  > e.xa <- ergm(samplike ~ edgecov(samplike, "YearsTrusted"))
  Observed statistic(s) edgecov.YearsTrusted are at their greatest attainable values. Their coefficients will be fixed at +Inf.
  All terms are either offsets or extreme values. No optimization is performed.
  > n.x <- try(summary(samplike~edgecov('dummy')),silent=TRUE)
  > set.network.attribute(samplike,'dummy',cov)
  > n2.x <- summary(samplike~edgecov('dummy'))
  > if (s.x!=134 || round(coef(e.x) + .5022,3)!=0  ||
  +     s.xa!=183 || coef(e.xa)!=+Inf ||
  +     !is(n.x,'try-error') || n2.x!=134) {
  +  print(list(s.x=s.x,e.x=e.x,s.xa=s.xa,e.xa=e.xa))
  +  stop("Failed edgecov test")
  + }else{
  +  num.passed.tests=num.passed.tests+1
  +  print("Passed edgecov test")
  + }
  [1] "Passed edgecov test"
  > 
  > 
  > 
  > # edges, either
  > num.tests=num.tests+1
  > s.0 <- summary(fmh~edges)
  > e.0 <- ergm(samplike~edges, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 203 || round(coef(e.0) + .9072, 3) != 0) {
  +  print(list(s.0=s.0, e.0=e.0))
  +  stop("Failed edges term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed edges term test")
  + }
  [1] "Passed edges term test"
  > 
  > for(cache.sp in c(FALSE, TRUE)){
  + 
  + if(cache.sp) print("Enabling shared partner cache...")
  + else print("Disabling shared partner cache...")
  + 
  + # dsp, either
  + num.tests=num.tests+1
  + s.d <- summary(fmh~dsp(2:3), cache.sp=cache.sp)
  + e.d <- ergm(samplike~dsp(4), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + if (!all(s.d==c(75,23)) ||
  +     round(coef(e.d) + .04275, 3) != 0) {
  +    print(list(s.d=s.d, e.d=e.d))
  +     stop("Failed dsp term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed dsp term test")
  + }
  + 
  + 
  + # esp, either
  + num.tests=num.tests+1
  + s.d <- summary(fmh~esp(2:3), cache.sp=cache.sp)
  + e.d <- ergm(samplike~esp(4), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + if (!all(s.d==c(36,13)) ||
  +     round(coef(e.d) - .3093, 3) != 0) {
  +    print(list(s.d=s.d, e.d=e.d))
  +     stop("Failed esp term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed esp term test")
  + }
  + 
  + 
  + # nsp, either
  + num.tests=num.tests+1
  + s.d <- summary(fmh~nsp(2:3), cache.sp=cache.sp)
  + e.d <- ergm(samplike~nsp(4), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + if (!all(s.d==c(39, 10)) ||
  +    round(coef(e.d) + 1.1096, 3) != 0) {
  +    print(list(s.d=s.d, e.d=e.d))
  +    stop("Failed nsp term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed nsp term test")
  + }
  + 
  +   
  + # gwdsp, either
  + num.tests=num.tests+1
  + s.0 <- summary(fmh~gwdsp, cache.sp=cache.sp)
  + e.0 <- ergm(samplike~gwdsp(0, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + e.a <- ergm(samplike~gwdsp(.8, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + s.f <- summary(fmh~gwdsp(0, fixed=TRUE), cache.sp=cache.sp)
  + s.af <- summary(fmh~gwdsp(.3, fixed=TRUE), cache.sp=cache.sp)
  + e.af <- ergm(samplike~gwdsp(.2, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + if (!all(head(s.0)==c(431, 75, 23, 1, 1, 0)) ||
  +     round(coef(e.0) + .3309974, 3) != 0 ||
  +     round(coef(e.a) + .1875983, 3) != 0 ||
  +     s.f!=531 ||
  +     round(s.af - 558.6369, 3) != 0 ||
  +     round(coef(e.af) + .2829672, 3) != 0) {
  +   print(list(s.0=head(s.0), e.0=e.0, e.a=e.a, s.f=s.f, s.af=s.af, e.af=e.af))
  +  stop("Failed gwdsp term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed gwdsp term test")
  + }
  + 
  + 
  + # gwesp, either
  + num.tests=num.tests+1
  + s.0 <- summary(fmh~gwesp, cache.sp=cache.sp)
  + e.0 <- ergm(samplike~gwesp(0, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + e.a <- ergm(samplike~gwesp(.8, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + s.f <- summary(fmh~gwesp(0, fixed=TRUE), cache.sp=cache.sp)
  + s.af <- summary(fmh~gwesp(.3, fixed=TRUE), cache.sp=cache.sp)
  + e.af <- ergm(samplike~gwesp(.2, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + if (!all(head(s.0)==c(70,36,13,0,1,0)) ||
  +     round(coef(e.0) + .4115515, 3) != 0 ||
  +     round(coef(e.a) + .1898684, 3) != 0 ||
  +     s.f!=120 ||
  +     round(s.af - 133.9215, 3) != 0 ||
  +     round(coef(e.af) + .3371385, 3) != 0) {
  +   print(list(s.0=head(s.0), e.0=e.0, e.a=e.a, s.f=s.f, s.af=s.af, e.af=e.af))
  +  stop("Failed gwesp term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed gwesp term test")
  + }
  + 
  + 
  + 
  + # gwnsp, either
  + num.tests=num.tests+1
  + s.0 <- summary(fmh~gwnsp, cache.sp=cache.sp)
  + e.0 <- ergm(samplike~gwnsp(0, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + e.a <- ergm(samplike~gwnsp(.8, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + s.f <- summary(fmh~gwnsp(0, fixed=TRUE), cache.sp=cache.sp)
  + s.af <- summary(fmh~gwnsp(.3, fixed=TRUE), cache.sp=cache.sp)
  + e.af <- ergm(samplike~gwnsp(.2, fixed=TRUE), estimate="MPLE", control=control.ergm(term.options=list(cache.sp=cache.sp)))
  + if (!all(head(s.0)==c(361,39,10,1,0,0)) ||
  +     round(coef(e.0) + .4189, 3) != 0 ||
  +     round(coef(e.a) + .3123, 3) != 0 ||
  +     s.f!=411 ||
  +     round(s.af - 424.7154, 3) != 0 ||
  +     round(coef(e.af) + .3934841, 3) != 0) {
  +   print(list(s.0=head(s.0), e.0=e.0, e.a=e.a, s.f=s.f, s.af=s.af, e.af=e.af))
  +  stop("Failed gwnsp term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed gwnsp term test")
  + }
  + 
  + }
  [1] "Disabling shared partner cache..."
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed dsp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed esp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed nsp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed gwdsp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed gwesp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed gwnsp term test"
  [1] "Enabling shared partner cache..."
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed dsp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed esp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed nsp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed gwdsp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed gwesp term test"
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  [1] "Passed gwnsp term test"
  > 
  > # hamming, any
  > num.tests=num.tests+1
  > mat.d <- matrix(0,18,18)
  > mat.u <- matrix(0, 205, 205)
  > set.seed(456)
  > # Using a covariate matrix that matches the edges exactly is too easy.
  > cov.d <- cbind(as.edgelist(samplike)[,2:1], rbinom(88, 3, .5))
  > set.seed(145)
  > cov.u <- cbind(as.edgelist(fmh), rbinom(203, 3, .5))
  > 
  > # although there are 4 non-required inputs, giving
  > # 16 combinations of inputs, I've exlcuded most that
  > # don't involve 'x' because w/o 'x', the results are
  > # 0 or largely negative, as the hamming distance is 
  > # compared between identical networks
  > s.0 <- 0# COMMENTED OUT FOR NOW BECAUSE IT'S BROKEN:  summary(samplike~hamming)
  > s.x <- summary(samplike~hamming(mat.d))
  > # and everything commented below is broke.
  > 
  > # should this really be NA
  > #e.x <- ergm(fmh~hamming(mat.u), estimate="MPLE")
  > ## OK
  > s.xc <- summary(samplike~hamming(mat.d, cov=cov.d))
  > # NA
  > #e.xc <- ergm(fmh~hamming(mat.u, cov=cov.u), estimate="MPLE")
  > # OK
  > s.xd <- summary(samplike~hamming(mat.d, defaultweight=.3))
  > # NA value
  > #e.xd <- ergm(samplike~hamming(mat.d, defaultweight=.3), estimate="MPLE")
  > # OK
  > s.xca <- summary(samplike~hamming(mat.d, cov=samplike, attrname="YearsTrusted"))
  > # NA
  > #e.xca <- ergm(fmh~hamming(mat.u, cov=fmh, attrname="Grade"), estimate="MPLE")
  > # OK
  > s.xcd<- summary(samplike~hamming(mat.d, cov=cov.d, defaultweight=.5))
  > # NA
  > #e.xcd<- ergm(samplike~hamming(mat.d, cov=cov.d, defaultweight=.5), estimate="MPLE")
  > # 0 & NA
  > #s.xcad<- summary(samplike~hamming(mat.d, samplike, "YearsTrusted", .5))
  > #e.xcad<- ergm(samplike~hamming(mat.d, samplike, "YearsTrusted", .5), estimate="MPLE")
  > if (FALSE && !all.equal(as.vector(c(s.0, s.x, s.xc, s.xd, s.xca, s.xcd)),
  +                as.vector(c(  0,  88,   84, 26.4,   183,   100)))) {
  +  print(list(s.0=s.0, s.x=s.x, s.xc=s.xc, s.xd=s.xd, s.xca=s.xca, s.xcd=s.xcd))
  +  stop("Failed hamming term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed hamming term test")
  + }
  [1] "Passed hamming term test"
  > 
  > 
  > # isolatededges, undirected
  > num.tests=num.tests+1
  > s.0 <- summary(fmh~isolatededges)
  > e.0 <- ergm(fmh~isolatededges, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.1 <- summary(bipnw2~isolatededges)
  > e.1 <- ergm(bipnw2~isolatededges, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > 
  > if (s.0 != 4 || s.1 != 25 || round(coef(e.0) - 0.01034, 3) != 0 || round(coef(e.1) + 0.1611, 3) != 0) {
  +  print(list(s.0=s.0, e.0=e.0, s.1=s.1, e.1=e.1))
  +  stop("Failed isolatededges term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed isolatededges term test")
  + }
  [1] "Passed isolatededges term test"
  > 
  > 
  >                      
  > # isolates, either
  > num.tests=num.tests+1
  > s.0 <- summary(samplike~isolates)
  > e.0 <- ergm(fmh~isolates, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 0 || round(coef(e.0) - 5.10979, 3) != 0) {
  +  print(list(s.0=s.0, e.0=e.0))
  +  stop("Failed isolates term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed isolates term test")
  + }
  [1] "Passed isolates term test"
  > 
  > 
  >                      
  > ## localtriangle, either
  > #num.tests=num.tests+1
  > #set.seed(85)
  > #x <- matrix(rbinom(324, 2, .5),18,18)
  > #s.x <- summary(samplike~localtriangle(x))
  > #e.x <- ergm(samplike~localtriangle(x), estimate="MPLE")
  > #s.xa <- summary(fmh~localtriangle(fmh, "GradeMet"))
  > #if (s.x != 56 || round(coef(e.x) + .1553, 3) != 0 ||
  > #    s.xa != 61) {
  > # print(list(s.x=s.x, e.x=e.x, s.xa=s.xa))
  > # stop("Failed localtriangle term test")
  > #} else {
  > #  num.passed.tests=num.passed.tests+1
  > #  print("Passed localtriangle term test")
  > #}
  > 
  > 
  >                 
  > # meandeg, either
  > num.tests=num.tests+1
  > s.0 <- summary(samplike~meandeg)
  > e.0 <- ergm(fmh~meandeg, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (round(s.0 - 4.8889, 3) != 0 ||
  +     round(coef(e.0) + 474.0647, 3) != 0) {
  +  print(list(s.0=s.0, e.0=e.0))
  +  stop("Failed meandeg term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed meandeg term test")
  + }
  [1] "Passed meandeg term test"
  > 
  > 
  >                 
  > #nodecov, either
  > num.tests=num.tests+1
  > s.a <- summary(samplike~nodecov("YearsServed"))
  > e.a <- ergm(fmh~nodecov("Grade"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.at <- summary(samplike~nodecov(~YearsServed^2))
  > e.at <- ergm(fmh~nodecov(~(.%v%"Grade")^2), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.att <- summary(samplike~nodecov(function(x)(x%v%"YearsServed")^2))
  > s.attt <- summary(samplike~nodecov(~poly(YearsServed,2,raw=TRUE)))
  > if (s.a != 906 || round(coef(e.a) + .271, 3) != 0 ||
  +     s.at != 5036 || round(coef(e.at) + .03199, 3) != 0 ||
  +     s.att != 5036 || any(s.attt != c(906,5036))) {
  +  print(list(s.a=s.a, e.a=e.a, s.at=s.at, e.at=e.at, s.att=s.att, s.attt=s.attt))
  +  stop("Failed nodecov term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed nodecov term test")
  + }
  [1] "Passed nodecov term test"
  > 
  > 
  > 
  > #nodefactor, either
  > num.tests=num.tests+1
  > s.a <- summary(fmh~nodefactor("Grade"))
  > e.a <- ergm(samplike~nodefactor(~group), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ab <- summary(fmh~nodefactor(function(x) x %v% "Sex", base=(4:5)))
  > e.ab <- ergm(samplike~nodefactor("Trinity", levels=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (!all(s.a==c(75, 65, 36, 49, 28)) ||
  +     !all(round(coef(e.a)+c(.9480, .3273),3)==0) ||
  +     !all(s.ab==c(235,171)) ||
  +     !all(round(coef(e.ab)+c(.4451, .4451, .4706),3)==0)) {
  +   print(list(s.a=s.a,e.a=e.a, s.ab=s.ab, e.ab=e.ab))
  +   stop("Failed nodefactor term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +   print("Passed nodefactor term test")
  + }
  [1] "Passed nodefactor term test"
  > 
  > 
  > 
  > #nodematch, either
  > num.tests=num.tests+1
  > s.a <- summary(fmh~nodematch("Race"))
  > e.a <- ergm(samplike~nodematch("Trinity"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ad <- summary(samplike~nodematch(function(x) x %v% "group", diff=TRUE))
  > e.ad <- ergm(fmh~nodematch("Sex", diff=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.ak <- summary(fmh~nodematch(~Grade, levels=3:4))
  > e.ak <- ergm(samplike~nodematch(function(x) x %v% "group", levels=2), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.adk <- summary(samplike~nodematch(~Trinity, TRUE, 1:2))
  In term 'nodematch' in package 'ergm': Argument 'keep' has been superseded by 'levels', and it is recommended to use the latter.  Note that its interpretation may be different.
  > e.adk <- ergm(fmh~nodematch("Race", TRUE, 2), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.a != 103 || round(coef(e.a) + 1.45725,3)!=0  ||
  +     !all(s.ad==c(23,10,30)) ||
  +     !all(round(coef(e.ad)+c(4.06317, 4.7032),3)==0) ||
  +     s.ak!=32 || !all(round(coef(e.ad)+c(4.063173, 4.703204),3)!=0 ||
  +     !all(s.adk==c(8,4)) ||
  +     round(coef(e.adk)+ 4.700995,3)==0)) {
  +  print(list(s.0=s.0, e.0=e.0, s.a=s.a, e.a=e.a, s.ad=s.ad, e.ad=e.ad, s.ak=s.ak,
  +             e.ak=e.ak, s.adk=e.adk))
  +  stop("Failed nodematch term test")
  + } else {
  +   num.passed.tests=num.passed.tests+1
  +  print("Passed nodematch term test")
  + }
  Error in round(coef(e.ad) + c(4.063173, 4.703204), 3) != 0 || !all(s.adk ==  : 
    'length = 2' in coercion to 'logical(1)'
  Execution halted
Running the tests in ‘tests/termTests.undirected.R’ failed.
Complete output:
  > #  File tests/termTests.undirected.R in package ergm, part of the
  > #  Statnet suite of packages for network analysis, https://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
  > #  https://statnet.org/attribution .
  > #
  > #  Copyright 2003-2021 Statnet Commons
  > ################################################################################
  > 
  > library(ergm)
  Loading required package: network
  
  'network' 1.17.1 (2021-06-12), part of the Statnet Project
  * 'news(package="network")' for changes since last version
  * 'citation("network")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  
  'ergm' 4.1.2 (2021-07-26), part of the Statnet Project
  * 'news(package="ergm")' for changes since last version
  * 'citation("ergm")' for citation information
  * 'https://statnet.org' for help, support, and other information
  
  'ergm' 4 is a major update that introduces some backwards-incompatible
  changes. Please type 'news(package="ergm")' for a list of major
  changes.
  
  > 
  > # an undirected nw
  > data(faux.mesa.high)
  > fmh <- faux.mesa.high
  > set.seed(7)
  > set.edge.attribute(fmh, "GradeMet", rbinom(203, 6, .5))
  > 
  > 
  > # a small undirected nw w/ lots o' triangles
  > set.seed(20)
  > t<-trunc(runif(160, 1, 20))
  > set.seed(21)
  > h<-trunc(runif(160, 1, 20))
  > el <- cbind(t,h)
  > bad <- which(el[,2]==el[,1])
  > el[bad,2] = el[bad,2]+1
  > unnw <- network(el, directed=FALSE)
  > unnw %v% "Pet" <- c("dog", "cat")
  > 
  > num.passed.tests=0
  > num.tests=0
  > 
  > #altkstar, undirected, 
  > num.tests=num.tests+1
  > s.0 <- summary(fmh~altkstar)
  > e.0 <- ergm(fmh~altkstar(1, fixed=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > e.l <- ergm(fmh~altkstar(.5, fixed=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.f <- summary(fmh~altkstar(1, fixed=TRUE))
  > e.lf <- ergm(fmh~altkstar(.9, fixed=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (!all(s.0[1:10]==c(51,30,28,18,10,2,4,1,2,1)) ||
  +     round(coef(e.0)+ 3.234, 3) !=0 ||
  +     round(coef(e.l)+ 4.166, 3) !=0 ||
  +     258 - s.f != 0 ||
  +     round(coef(e.lf)+ 3.494, 3) !=0) {
  +  print(list(s.0=s.0,e.0=e.0, e.l=e.l, s.f=s.f, e.lf=e.lf))
  +  stop("Failed altkstar term test")
  + } else {
  +  num.passed.tests = num.passed.tests+1
  +  print("Passed altkstar term test")
  + }
  [1] "Passed altkstar term test"
  > 
  > 
  > # concurrent, undirected
  > num.tests=num.tests+1
  > s.0 <- summary(fmh~concurrent)
  > e.0 <- ergm(fmh~concurrent, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.b <- summary(fmh~concurrent(by=function(x) x %v% "Grade"))
  > e.b <- ergm(fmh~concurrent(by="Sex"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 97 || round(coef(e.0) + 4.871, 3) != 0 ||
  +     !all(s.b==c(35,15,18,8,13,8)) ||
  +     !all(round(coef(e.b) + c(5.17301, 4.67697), 3) == 0)) {
  +     print(list(s.0=s.0, e.0=e.0, s.b=s.b, e.b=e.b))
  +  stop("Failed concurrent term test")
  + } else {
  +   num.passed.tests = num.passed.tests+1
  +   print("Passed concurrent term test")
  + }
  [1] "Passed concurrent term test"
  > 
  > #concurrentties, undirected
  > num.tests=num.tests+1
  > s.0 <- summary(fmh~concurrentties)
  > e.0 <- ergm(fmh~concurrentties, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.b <- summary(fmh~concurrentties(by="Grade"))
  > e.b <- ergm(fmh~concurrentties(by=~Sex), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (!all(s.0==258)||round(coef(e.0)+3.234,3)!=0 ||
  +     !all(s.b==c(103,51,36,19,31,18))||
  +     !all(round(coef(e.b)+c(3.078,3.429),3)==0))  {
  + 	print(list(s.0=s.0,e.0=e.0, s.b=s.b, e.b=e.b))
  + 	stop("Failed concurrentties term test")
  + } else {
  + 	num.passed.tests = num.passed.tests+1
  + 	print("Passed concurrentties term test")
  + }
  [1] "Passed concurrentties term test"
  > 
  > # cyclicalties, directed
  > num.tests=num.tests + 1
  > s.0 <- summary(fmh~cyclicalties)
  > e.0 <- ergm(fmh~cyclicalties, estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.a <- summary(fmh~cyclicalties("Race"))
  > e.a <- ergm(fmh~cyclicalties("Race"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (s.0 != 120 || round(coef(e.0) + 0.4868, 3) != 0 ||
  +     s.a != 40 || round(coef(e.a) + 0.4430, 3) != 0) {
  + 	print(list(s.0=s.0, e.0=e.0, s.a=s.a, e.a=e.a))
  + 	stop("Failed cyclicalties term test")
  + } else {
  + 	num.passed.tests=num.passed.tests+1
  + 	print("Passed cyclicalties term test")
  + }
  [1] "Passed cyclicalties term test"
  > 
  > 
  > # degree, undirected
  > num.tests=num.tests+1
  > s.d <- summary(fmh~degree(2:3))
  > e.d <- ergm(fmh~degree(0), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.db <- summary(fmh~degree(1:3, function(x) x %v% "Grade"))
  > e.db <- ergm(fmh~degree(4, "Sex"), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.dbh <- summary(fmh~degree(4:5, by="Sex", homophily=TRUE))
  > e.dbh <- ergm(fmh~degree(2, by=~Grade, homophily=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (!all(s.d==c(30,28)) || round(coef(e.d) - 5.11, 3) != 0 ||
  +     !all(s.db==c(15,9,9,9,4,2,11,5,9,9,4,2,5,5,4,2,3,2)) ||
  +     !all(round(coef(e.db)+c(.345, .6005),3)==0) ||
  +     !all(s.dbh==c(10,3)) || round(coef(e.dbh) +.5713,3) !=0) {
  +  print(list(s.d=s.d, e.d=e.d, s.db=s.db, e.db=e.db, s.dbh=s.dbh, e.dbh=e.dbh))
  +  stop("Failed degree term test")
  + } else {
  +   print("Passed degree term test")
  +   num.passed.tests = num.passed.tests+1
  + }
  [1] "Passed degree term test"
  > 
  > 
  > 
  > # degrange, undirected
  > num.tests=num.tests + 1
  > s.0 <- summary(fmh~degrange(1:3))
  > e.0 <- ergm(fmh~degrange(1:3), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > s.h <- summary(fmh~degrange(1:3, by="Sex", homophily=TRUE))
  > e.h <- ergm(fmh~degrange(1:3, by=~Sex, homophily=TRUE), estimate="MPLE")
  Starting maximum pseudolikelihood estimation (MPLE):
  Evaluating the predictor and response matrix.
  Maximizing the pseudolikelihood.
  Finished MPLE.
  Stopping at the initial estimate.
  Evaluating log-likelihood at the estimate. 
  > if (!all(s.0==c(148, 97, 67)) || round(coef(e.0) + c(4.349, 4.067, 3.178  ))!= 0 ||!all(s.h==c(122, 65, 36)) || round(coef(e.h) + c(3.389, 3.032, 2.368 ))!= 0) {
  + 	print(list(s.0=s.0, e.0=e.0, s.h=s.h, e.h=e.h))
  + 	stop("Failed degrange term test")
  + } else {
  + 	print("Passed degrange term test")
  + 	num.passed.tests = num.passed.tests+1
  + }
  Error in !all(s.0 == c(148, 97, 67)) || round(coef(e.0) + c(4.349, 4.067,  : 
    'length = 3' in coercion to 'logical(1)'
  Execution halted