[Rsiena-commits] r347 - in pkg: RSiena RSiena/R RSiena/man RSiena/tests RSienaTest RSienaTest/R RSienaTest/doc RSienaTest/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Feb 16 18:03:51 CET 2020


Author: tomsnijders
Date: 2020-02-16 18:03:50 +0100 (Sun, 16 Feb 2020)
New Revision: 347

Modified:
   pkg/RSiena/ChangeLog
   pkg/RSiena/DESCRIPTION
   pkg/RSiena/NAMESPACE
   pkg/RSiena/R/initializeFRAN.r
   pkg/RSiena/R/siena08.r
   pkg/RSiena/R/sienaGOF.r
   pkg/RSiena/R/sienatable.r
   pkg/RSiena/cran-comments.md
   pkg/RSiena/man/RSiena-package.Rd
   pkg/RSiena/man/sienaGOF-auxiliary.Rd
   pkg/RSiena/man/sienaGOF.Rd
   pkg/RSiena/tests/parallel.Rout.save
   pkg/RSienaTest/ChangeLog
   pkg/RSienaTest/DESCRIPTION
   pkg/RSienaTest/NAMESPACE
   pkg/RSienaTest/R/initializeFRAN.r
   pkg/RSienaTest/R/siena08.r
   pkg/RSienaTest/R/sienaBayes.r
   pkg/RSienaTest/R/sienaGOF.r
   pkg/RSienaTest/R/sienatable.r
   pkg/RSienaTest/doc/HowToCommit.pdf
   pkg/RSienaTest/doc/HowToCommit.tex
   pkg/RSienaTest/doc/RSiena.bib
   pkg/RSienaTest/doc/RSiena_Manual.pdf
   pkg/RSienaTest/doc/RSiena_Manual.tex
   pkg/RSienaTest/man/RSiena-package.Rd
   pkg/RSienaTest/man/sienaGOF-auxiliary.Rd
   pkg/RSienaTest/man/sienaGOF.Rd
Log:
Version 1.2-24

Modified: pkg/RSiena/ChangeLog
===================================================================
--- pkg/RSiena/ChangeLog	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/ChangeLog	2020-02-16 17:03:50 UTC (rev 347)
@@ -1,3 +1,12 @@
+2020-02-16 R-Forge Revision 347, package version 1.2-24.
+   * Changes in RSiena and RSienaTest:
+   * New auxiliary function dyadicCov.
+   * Correction of error in modelType when one-mode as well as two-mode
+     networks are used (initializeFRAN.r).
+Changes in RSienaTest:
+   * Corrected siena.table for sienaBayesFit objects;
+     added startingDate in sienaBayes and siena08 to the object produced. 
+
 2020-01-15 R-Forge Revision 346, version 1.2-23 same as CRAN version
 (except that one error in dontrun part of sienaGOF-auxiliary.Rd was corrected).
 

Modified: pkg/RSiena/DESCRIPTION
===================================================================
--- pkg/RSiena/DESCRIPTION	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/DESCRIPTION	2020-02-16 17:03:50 UTC (rev 347)
@@ -2,8 +2,8 @@
 Package: RSiena
 Type: Package
 Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.2-23
-Date: 2020-01-12
+Version: 1.2-24
+Date: 2020-02-16
 Author: Ruth Ripley, Krists Boitmanis, Tom A.B. Snijders, Felix Schoenenberger,
    Nynke Niezink
 Depends: R (>= 2.15.0)

Modified: pkg/RSiena/NAMESPACE
===================================================================
--- pkg/RSiena/NAMESPACE	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/NAMESPACE	2020-02-16 17:03:50 UTC (rev 347)
@@ -11,7 +11,7 @@
 	includeTimeDummy, sienaGOF, descriptives.sienaGOF, sienaRI,
 	sparseMatrixExtraction, networkExtraction, behaviorExtraction,
 	OutdegreeDistribution, IndegreeDistribution, BehaviorDistribution,
-	TriadCensus, mixedTriadCensus,
+	TriadCensus, mixedTriadCensus, dyadicCov,
 	siena.table, xtable, score.Test, Wald.RSiena, Multipar.RSiena
 )
 

Modified: pkg/RSiena/R/initializeFRAN.r
===================================================================
--- pkg/RSiena/R/initializeFRAN.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/R/initializeFRAN.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -140,7 +140,7 @@
 		# Check that the following attributes have correct names
 		checkNames(x$MaxDegree, c('oneMode','bipartite'))
 		checkNames(x$UniversalOffset, c('oneMode','bipartite'))
-		checkNames(x$modelType, 'oneMode')
+		checkNames(x$modelType, c('oneMode','bipartite'))
 		checkNames(x$behModelType, 'behavior')
 		# The following error will occur if ML estimation is requested
 		# and there are any impossible changes from structural values

Modified: pkg/RSiena/R/siena08.r
===================================================================
--- pkg/RSiena/R/siena08.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/R/siena08.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -206,6 +206,7 @@
 	meta$requestedEffects <- requestedEffects
 	meta$theta <- meta.theta
 	meta$se <- meta.se
+	meta$startingDate <- date()
     meta
 }
 

Modified: pkg/RSiena/R/sienaGOF.r
===================================================================
--- pkg/RSiena/R/sienaGOF.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/R/sienaGOF.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -1399,3 +1399,33 @@
   tc[levls]
 }
 
+
+##@dyadicCov sienaGOF Auxiliary variable for dyadic covariate
+#
+# An auxiliary function calculating the proportion of ties
+# for subsets of ordered pairs corresponding to
+# certain values of the categorical dyadic covariate dc.
+# dc should be a matrix of the same dimensions as
+# the dependent variable.
+dyadicCov <-  function (i, obsData, sims, period, groupName,
+                           varName, dc, dc.table=NULL){
+	m <- sparseMatrixExtraction(i, obsData, sims, period, groupName, varName)
+	tmdyv <- table((m*dc)@x) # note that m*dc is a sparse matrix, too
+	if (is.null(dc.table))
+	{
+		tdyv <- table(dc)
+	}
+	else
+	{
+		tdyv <- dc.table
+	}
+	# Now we want to construct the proportions of m*dyv in dyv;
+	# and categories in dyv not represented in m*dyv should get a 0.
+	# First make a vector of the correct length with 0s in place.
+	ttmdyv <- 0*tdyv
+	dims <- dimnames(tmdyv)[[1]]
+	ttmdyv[dims] <- tmdyv
+	z <- ttmdyv/tdyv
+#	names(z) <- dims
+	z
+}

Modified: pkg/RSiena/R/sienatable.r
===================================================================
--- pkg/RSiena/R/sienatable.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/R/sienatable.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -7,7 +7,7 @@
 ##  *
 ##  * Description: This file contains the code to save a latex or html table of
 ##  * estimates for a sienaFit or sienaBayesFit object
-##  * Written by Charlotte Greenan; small modifications by Tom Snijders.
+##  * Written by Charlotte Greenan; modifications by Tom Snijders.
 ##  *
 ##  ***************************************************************************/
 
@@ -32,8 +32,7 @@
 			if (is.null(nfirst))
 			{
 				nfirst <- x$nwarm + 1
-				message
-("Note: the print function for sienaBayesFit objects can also use a parameter nfirst,")
+				message("Note: the print function for sienaBayesFit objects can also use a parameter nfirst,")
 				message("    indicating the first run from which convergence is assumed.")
 				message("    The default value used now is nfirst =",
 					x$nwarm + 1, ".")
@@ -48,8 +47,14 @@
 	effects <- x$requestedEffects
 	p <- x$pp
 	condrates <- 0
+	if (fromBayes)
+	{
+		nwaves <- attr(x$initialResults$f,'observations')
+	}
+	else
+	{
 	nwaves <- dim(x$targets2)[2]
-
+	}
 	if (x$cconditional)
 	{
 		condrates <- length(x$rate)

Modified: pkg/RSiena/cran-comments.md
===================================================================
--- pkg/RSiena/cran-comments.md	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/cran-comments.md	2020-02-16 17:03:50 UTC (rev 347)
@@ -1,3 +1,8 @@
+# Note: this file is not part of the .tar.gz file,
+# but just an internal note for the maintainer.
+# See R-package-devel Digest, Vol 57, Issue 18.
+# See .Rbuildignore
+
 # RSiena new version 1.2-23 (2020-01-12)
 
 ## Passed checks on Windows, Mac, and Linux for R-release and R-devel.

Modified: pkg/RSiena/man/RSiena-package.Rd
===================================================================
--- pkg/RSiena/man/RSiena-package.Rd	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/man/RSiena-package.Rd	2020-02-16 17:03:50 UTC (rev 347)
@@ -44,8 +44,8 @@
   \tabular{ll}{
     Package: \tab RSiena\cr
     Type: \tab Package\cr
-    Version: \tab 1.2-23\cr
-    Date: \tab 2020-01-12\cr
+    Version: \tab 1.2-24\cr
+    Date: \tab 2020-02-16\cr
     Depends: \tab R (>= 3.0.0)\cr
     Imports: \tab Matrix\cr
     Suggests: \tab tcltk, network, codetools, lattice, MASS, parallel,

Modified: pkg/RSiena/man/sienaGOF-auxiliary.Rd
===================================================================
--- pkg/RSiena/man/sienaGOF-auxiliary.Rd	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/man/sienaGOF-auxiliary.Rd	2020-02-16 17:03:50 UTC (rev 347)
@@ -8,6 +8,7 @@
 \alias{BehaviorDistribution}
 \alias{TriadCensus}
 \alias{mixedTriadCensus}
+\alias{dyadicCov}
 
 \title{Auxiliary functions for goodness of fit assessment by \code{\link{sienaGOF}}}
 \description{
@@ -42,6 +43,9 @@
 
 mixedTriadCensus(i, obsData, sims, period, groupName, varName)
 
+dyadicCov(i, obsData, sims, period, groupName, varName,
+          dc, dc.table=NULL)
+
 sparseMatrixExtraction(i, obsData, sims, period, groupName, varName)
 
 networkExtraction(i, obsData, sims, period, groupName, varName)
@@ -68,6 +72,11 @@
     range of values.}
   \item{cumulative}{ Are the distributions to be considered as raw or
     cumulative (<=) distributions?}
+  \item{dc}{Dyadic covariate: matrix with the same dimensions as
+    adjacency matrix for dependent network variable.}
+  \item{dc.table}{Used as denominator for counts of dc. Can be given as
+    table for dc, calculated in advance, to circumvent calculating
+    \code{table(dc)} a large number of times.}
 }
 \details{
  The statistics should be chosen to represent features of the network
@@ -102,6 +111,11 @@
  The Batagelj-Mrvar algorithm is optimized for sparse, large graphs and may be
  much faster than the procedure implemented in \code{sna}. For dense graphs
  the \code{sna} procedure may be faster.
+
+ \code{dyadicCov} assumes that \code{dc} is a categorical dyadic variable,
+ and the frequencies of the values for realized ties are returned divided by
+ the elements of \code{dc.table}, which normally is the table of
+ overall frequencies of values of \code{dc}.
  }
 
 \value{
@@ -151,19 +165,17 @@
 \itemize{
 \item Batagelj, V., and Mrvar, A. (2001).
   A subquadratic triad census algorithm for large sparse networks with small
-  maximum degree. \emph{Social networks}, 23, 237-243.
+  maximum degree. \emph{Social Networks}, 23, 237-243.
 \item See \url{http://www.stats.ox.ac.uk/~snijders/siena/}
   for general information on RSiena.
-\item Holland, Paul W., and Leinhardt, Samuel (1976).
+\item Holland, P.W., and Leinhardt, S. (1976).
   Local structure in social networks. \emph{Sociological Methodology}, 6, 1-45.
 \item Hollway, J., Lomi, A., Pallotti, F., and Stadtfeld, C. (2017)
    Multilevel social spaces: The network dynamics of organizational fields.
    \emph{Network Science}, 5(2), 187-212.
-\item Lospinoso, J.A. and Snijders, T.A.B., (2011).
-  \dQuote{Goodness of fit for Stochastic Actor Oriented Models.}
-  Presentation given at Sunbelt XXXI, St. Petes Beach, FL.
-\item Lospinoso, J.A. (2012). \dQuote{Statistical Models for Social Network Dynamics.}
-Ph.D. Thesis. University of Oxford: U.K.
+\item Lospinoso, J.A. and Snijders, T.A.B. (2019).
+  Goodness of fit for stochastic actor-orientedmodels.
+  \emph{Methodological Innovations}, 12:2059799119884282.
 \item Parimalarangan S., Slota, G.M., and Madduri, K. (2017).
  Fast parallel graph triad census and triangle counting on shared-memory platforms,
  2017 IEEE International Parallel and Distributed Processing Symposium Workshops
@@ -177,6 +189,8 @@
 
 mynet1 <- sienaDependent(array(c(s501, s502), dim=c(50, 50, 2)))
 mybeh <- sienaDependent(s50a[,1:2], type="behavior")
+mydycov <- matrix(rep(1:5, 500), 50, 50) # artificial, just for trying
+mydy.table <- table(mydycov)
 mydata <- sienaDataCreate(mynet1, mybeh)
 myeff <- getEffects(mydata)
 myeff <- includeEffects(myeff, transTies, cycle3)
@@ -185,8 +199,12 @@
 (ans <- siena07(myalgorithm, data=mydata, effects=myeff, returnDeps=TRUE,
    batch=TRUE))
 
+# NULL for the observations:
 OutdegreeDistribution(NULL, ans$f, ans$sims, period=1, groupName="Data1",
   levls=0:7, varName="mynet1")
+dyadicCov(NULL, ans$f, ans$sims, period=1, groupName="Data1",
+  dc=mydycov, dc.table=mydy.table, varName="mynet1")
+# An arbitrary selection for simulation run i:
 IndegreeDistribution(5, ans$f, ans$sims, period=1, groupName="Data1",
   varName="mynet1")
 BehaviorDistribution(20, ans$f, ans$sims, period=1, groupName="Data1",
@@ -208,6 +226,10 @@
 # cumulative is an example of "\dots".
 plot(gofo)
 
+(gofdc <- sienaGOF(ans, dyadicCov, verbose=TRUE, join=TRUE,
+    dc=mydycov, dc.table=mydy.table, varName="mynet1"))
+plot(gofdc)
+
 (gofb <- sienaGOF(ans, BehaviorDistribution, varName = "mybeh",
     verbose=TRUE, join=TRUE, cumulative=FALSE))
 plot(gofb)
@@ -379,7 +401,7 @@
 mybeh <- sienaDependent(s50a, type="behavior")
 mydata <- sienaDataCreate(mynet1, mybeh)
 myeff <- getEffects(mydata)
-myeff <- includeEffects(myeff, transTrip, cycle3, nbrDist2)
+myeff <- includeEffects(myeff, transTrip, cycle3)
 myeff <- includeEffects(myeff, outdeg, name="mybeh", interaction1="mynet1")
 myeff <- includeEffects(myeff,  outdeg, name="mybeh", interaction1="mynet1")
 # Shorter phases 2 and 3, just for example:

Modified: pkg/RSiena/man/sienaGOF.Rd
===================================================================
--- pkg/RSiena/man/sienaGOF.Rd	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/man/sienaGOF.Rd	2020-02-16 17:03:50 UTC (rev 347)
@@ -214,12 +214,9 @@
 \itemize{
 \item See \url{http://www.stats.ox.ac.uk/~snijders/siena/}
   for general information on RSiena.
-\item Lospinoso, J.A. and Snijders, T.A.B., \dQuote{Goodness of fit for
-  Stochastic Actor Oriented Models.} Presentation given at Sunbelt XXXI,
-  St. Petes Beach, Fl. 2011.
-\item Lospinoso, J.A. (2012).
-  \dQuote{Statistical Models for Social Network Dynamics.}
-  Ph.D. Thesis. University of Oxford: U.K.
+\item Lospinoso, J.A. and Snijders, T.A.B. (2019).
+  Goodness of fit for stochastic actor-orientedmodels.
+  \emph{Methodological Innovations}, 12:2059799119884282.
 }
 }
 \author{Josh Lospinoso, modifications by Ruth Ripley and Tom Snijders}

Modified: pkg/RSiena/tests/parallel.Rout.save
===================================================================
--- pkg/RSiena/tests/parallel.Rout.save	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSiena/tests/parallel.Rout.save	2020-02-16 17:03:50 UTC (rev 347)
@@ -24,9 +24,7 @@
 > myeff<- getEffects(mydata)
 > mymodel<- model.create(findiff=TRUE, fn = simstats0c,
 +                        cond=FALSE, nsub=2, n3=50, seed=3)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > print('test3')
 [1] "test3"
 > ans<- siena07(mymodel, data=mydata, effects=myeff,
@@ -98,9 +96,7 @@
 > myeff<- getEffects(mydata)
 > mymodel<- model.create(fn = simstats0c,  nsub=2, n3=50,
 +                        cond=FALSE, seed=5)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > print('test5')
 [1] "test5"
 > ans<- siena07(mymodel, data=mydata, effects=myeff,  batch=TRUE,
@@ -157,9 +153,7 @@
 > myeff<- getEffects(mydata)
 > mymodel<- model.create(fn = simstats0c,  nsub=2, n3=50,
 +                        cond=FALSE, doubleAveraging=0,seed=5)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > print('test6')
 [1] "test6"
 > ans<- siena07(mymodel, data=mydata, effects=myeff,  batch=TRUE,
@@ -184,9 +178,7 @@
 > myeff<- getEffects(mydata)
 > mymodel<- model.create(fn = simstats0c,  nsub=2, n3=50,
 +                        cond=FALSE,  diagonalize=0.5, seed=5)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > print('test7')
 [1] "test7"
 > ans<- siena07(mymodel, data=mydata, effects=myeff,  batch=TRUE,
@@ -209,9 +201,7 @@
 > ##test8
 > mymodel<- model.create(fn = simstats0c,  nsub=1, n3=50,
 +                        cond=TRUE, condvarno=1, seed=5)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > print('test8')
 [1] "test8"
 > ans <- siena07(mymodel, data=mydata, effects=myeff,  batch=TRUE,
@@ -288,9 +278,7 @@
 [1] "test11"
 > mymodel<- model.create(fn = simstats0c,  nsub=1, n3=50,
 +                        behModelType=c(mynet2=2), seed=6)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > (ans <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE,
 +                parallelTesting=TRUE, silent=TRUE))
 Estimates, standard errors and convergence t-ratios
@@ -339,9 +327,7 @@
 1 myvar1 in-alter dist 2 TRUE    FALSE FALSE          0   1   
 > ans <- siena07(sienaModelCreate(n3=50, nsub=2, seed=1),
 +                data=mydata, effects=myeff, batch=TRUE, silent=TRUE)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > ans
 Estimates, standard errors and convergence t-ratios
 
@@ -421,9 +407,7 @@
 1 myvar1 ego TRUE    FALSE FALSE          0   0   
 > (ans <- siena07(sienaModelCreate(n3=50, nsub=2, seed=1),
 +                data=mydata, effects=myeff, batch=TRUE, silent=TRUE))
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 Estimates, standard errors and convergence t-ratios
 
                                  Estimate   Standard   Convergence 
@@ -452,9 +436,7 @@
   effectName            include fix   test  initialValue parm
 1 indegree - popularity TRUE    FALSE FALSE          0   0   
 > algo <- sienaAlgorithmCreate(nsub=1, n3=20, maxlike=TRUE, seed=15, mult=1)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > (ans <- siena07(algo, data=dataset, effects=myeff, batch=TRUE, silent=TRUE))
 Estimated by Maximum Likelihood
 
@@ -511,9 +493,7 @@
 6 behavior feedback from behavior      TRUE    FALSE FALSE   -0.11172   0
 7 behavior intercept                   TRUE    FALSE FALSE   -0.86402   0
 > algorithmMoM <- sienaAlgorithmCreate(nsub=1, n3=20, seed=321)
-## IGNORE_RDIFF_BEGIN
 siena07 will create an output file Siena.txt .
-## IGNORE_RDIFF_END
 > (ans <- siena07(algorithmMoM, data = mydata, effects = myeff, batch=TRUE))
 SDE init parameters:  -0.1519645 -1.175127 0.7355777
 SDE par stand errors: 0.06428706 0.2889378 0.1507865

Modified: pkg/RSienaTest/ChangeLog
===================================================================
--- pkg/RSienaTest/ChangeLog	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/ChangeLog	2020-02-16 17:03:50 UTC (rev 347)
@@ -1,3 +1,12 @@
+2020-02-16 R-Forge Revision 347, package version 1.2-24.
+   * Changes in RSiena and RSienaTest:
+   * New auxiliary function dyadicCov.
+   * Correction of error in modelType when one-mode as well as two-mode
+     networks are used (initializeFRAN.r).
+Changes in RSienaTest:
+   * Corrected siena.table for sienaBayesFit objects;
+     added startingDate in sienaBayes and siena08 to the object produced. 
+
 2020-01-15 R-Forge Revision 346, version 1.2-23 same as CRAN version
 (except that one error in dontrun part of sienaGOF-auxiliary.Rd was corrected).
 

Modified: pkg/RSienaTest/DESCRIPTION
===================================================================
--- pkg/RSienaTest/DESCRIPTION	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/DESCRIPTION	2020-02-16 17:03:50 UTC (rev 347)
@@ -2,8 +2,8 @@
 Package: RSienaTest
 Type: Package
 Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.2-23
-Date: 2020-01-12
+Version: 1.2-24
+Date: 2020-02-16
 Author: Ruth Ripley, Krists Boitmanis, Tom A.B. Snijders, Felix Schoenenberger,
    Nynke Niezink
 Depends: R (>= 2.15.0)

Modified: pkg/RSienaTest/NAMESPACE
===================================================================
--- pkg/RSienaTest/NAMESPACE	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/NAMESPACE	2020-02-16 17:03:50 UTC (rev 347)
@@ -12,7 +12,7 @@
 	includeTimeDummy, sienaGOF, descriptives.sienaGOF, sienaRI,
 	sparseMatrixExtraction, networkExtraction, behaviorExtraction,
 	OutdegreeDistribution, IndegreeDistribution, BehaviorDistribution,
-	TriadCensus, mixedTriadCensus,
+	TriadCensus, mixedTriadCensus, dyadicCov,
 	siena.table, xtable, score.Test, Wald.RSiena, Multipar.RSiena
 )
 

Modified: pkg/RSienaTest/R/initializeFRAN.r
===================================================================
--- pkg/RSienaTest/R/initializeFRAN.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/R/initializeFRAN.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -140,7 +140,7 @@
 		# Check that the following attributes have correct names
 		checkNames(x$MaxDegree, c('oneMode','bipartite'))
 		checkNames(x$UniversalOffset, c('oneMode','bipartite'))
-		checkNames(x$modelType, 'oneMode')
+		checkNames(x$modelType, c('oneMode','bipartite'))
 		checkNames(x$behModelType, 'behavior')
 		# The following error will occur if ML estimation is requested
 		# and there are any impossible changes from structural values

Modified: pkg/RSienaTest/R/siena08.r
===================================================================
--- pkg/RSienaTest/R/siena08.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/R/siena08.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -206,6 +206,7 @@
 	meta$requestedEffects <- requestedEffects
 	meta$theta <- meta.theta
 	meta$se <- meta.se
+	meta$startingDate <- date()
     meta
 }
 

Modified: pkg/RSienaTest/R/sienaBayes.r
===================================================================
--- pkg/RSienaTest/R/sienaBayes.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/R/sienaBayes.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -2437,6 +2437,7 @@
 	}
 	## z$returnDataFrame <- TRUE # chains come back as data frames not lists
 	z$returnChains <- FALSE
+	z$startingDate <- date()
 	z
 } # end initializeBayes
 

Modified: pkg/RSienaTest/R/sienaGOF.r
===================================================================
--- pkg/RSienaTest/R/sienaGOF.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/R/sienaGOF.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -981,7 +981,7 @@
 				obsData[[groupName]]$depvars[[varName]][[period+1]] %% 10))
 			extractedMatrix[is.na(extractedMatrix)] <- 0
 			if (attr(obsData[[groupName]]$depvars[[varName]], "structural"))
-			{	
+			{
 				extractedMatrix <- changeToStructural(extractedMatrix,
 					Matrix(obsData[[groupName]]$depvars[[varName]][[period]]))
 			}
@@ -992,7 +992,7 @@
 			Matrix(obsData[[groupName]]$depvars[[varName]][,,period+1] %% 10)
 			extractedMatrix[is.na(extractedMatrix)] <- 0
 			if (attr(obsData[[groupName]]$depvars[[varName]], "structural"))
-			{	
+			{
 				extractedMatrix <- changeToStructural(extractedMatrix,
 					Matrix(obsData[[groupName]]$depvars[[varName]][,,period]))
 			}
@@ -1397,3 +1397,33 @@
   tc[levls]
 }
 
+
+##@dyadicCov sienaGOF Auxiliary variable for dyadic covariate
+#
+# An auxiliary function calculating the proportion of ties
+# for subsets of ordered pairs corresponding to
+# certain values of the categorical dyadic covariate dc.
+# dc should be a matrix of the same dimensions as
+# the dependent variable.
+dyadicCov <-  function (i, obsData, sims, period, groupName,
+                           varName, dc, dc.table=NULL){
+	m <- sparseMatrixExtraction(i, obsData, sims, period, groupName, varName)
+	tmdyv <- table((m*dc)@x) # note that m*dc is a sparse matrix, too
+	if (is.null(dc.table))
+	{
+		tdyv <- table(dc)
+	}
+	else
+	{
+		tdyv <- dc.table
+	}
+	# Now we want to construct the proportions of m*dyv in dyv;
+	# and categories in dyv not represented in m*dyv should get a 0.
+	# First make a vector of the correct length with 0s in place.
+	ttmdyv <- 0*tdyv
+	dims <- dimnames(tmdyv)[[1]]
+	ttmdyv[dims] <- tmdyv
+	z <- ttmdyv/tdyv
+#	names(z) <- dims
+	z
+}

Modified: pkg/RSienaTest/R/sienatable.r
===================================================================
--- pkg/RSienaTest/R/sienatable.r	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/R/sienatable.r	2020-02-16 17:03:50 UTC (rev 347)
@@ -7,7 +7,7 @@
 ##  *
 ##  * Description: This file contains the code to save a latex or html table of
 ##  * estimates for a sienaFit or sienaBayesFit object
-##  * Written by Charlotte Greenan; small modifications by Tom Snijders.
+##  * Written by Charlotte Greenan; modifications by Tom Snijders.
 ##  *
 ##  ***************************************************************************/
 
@@ -32,10 +32,9 @@
 			if (is.null(nfirst))
 			{
 				nfirst <- x$nwarm + 1
-				message
-("Note: the print function for sienaBayesFit objects can also use a parameter nfirst,")
+				message("Note: the print function for sienaBayesFit objects can also use a parameter nfirst,")
 				message("    indicating the first run from which convergence is assumed.")
-				message("    The default value used now is nfirst =",
+				message("    The default value used now is nfirst = ",
 					x$nwarm + 1, ".")
 			}
 			xkind.string <- "sienaBayesFit"
@@ -48,8 +47,14 @@
 	effects <- x$requestedEffects
 	p <- x$pp
 	condrates <- 0
-	nwaves <- dim(x$targets2)[2]
-
+	if (fromBayes)
+	{
+		nwaves <- attr(x$initialResults$f,'observations')
+	}
+	else
+	{
+		nwaves <- dim(x$targets2)[2]
+	}
 	if (x$cconditional)
 	{
 		condrates <- length(x$rate)
@@ -424,7 +429,7 @@
 		}
 		else		
 		{
-			startdate <- paste("%Estimation date",x$startingDate)
+			startdate <- paste("% Estimation date",x$startingDate)
 		}
 		startTable <- tableSection(c(paste("% Table based on", xkind.string, "object",
 					deparse(substitute(x)), ',', date()),

Modified: pkg/RSienaTest/doc/HowToCommit.pdf
===================================================================
(Binary files differ)

Modified: pkg/RSienaTest/doc/HowToCommit.tex
===================================================================
--- pkg/RSienaTest/doc/HowToCommit.tex	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/doc/HowToCommit.tex	2020-02-16 17:03:50 UTC (rev 347)
@@ -152,8 +152,8 @@
   Do this also for the most recent patched version of R, because R-Forge will do this
   and often it leads to additional errors and notes, because R becomes progressively
   stringent.
-  
 
+
 There is a facility to check Windows packages on CRAN. See
 \url{http://win-builder.r-project.org/}; use the upload page!
 
@@ -161,6 +161,11 @@
 is at \url{https://builder.r-hub.io}; in the `advanced' page
 there is a variety of platforms on which you can check.
 
+In case R-hub throws unexplainable problems, you might consult
+the R-hub issue tracker:
+\url{https://github.com/r-hub/rhub/issues}
+
+
   Try to make the code so that notes and warnings from this Check are avoided as far as possible,
   and that you understand those that remain.
   There should of course be no errors at all.
@@ -175,4 +180,19 @@
 
   It may be useful to add other scripts for checking (but they should not consume much time).
 
+\section{Committing}
+
+Essential reading is \emph{Writing R extensions},\\
+\url{https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Checking-packages}
+(exists also in an \textit{r-devel} version!).
+
+CRAN policies are not constant; see, e.g., Hornik, Ligges and Zeileis. 
+``Changes on CRAN: 2017-12-01 to 2018-06-30'', 
+R Journal 10(1), July 2018. \url{https://journal.r-project.org/archive/2018-1/cran.pdf}
+\medskip
+
+The queue at CRAN is shown in the ``CRAN incoming dashboard'', 
+          \url{https://cransays.itsalocke.com/articles/dashboard.html}
+
+
 \end{document}

Modified: pkg/RSienaTest/doc/RSiena.bib
===================================================================
--- pkg/RSienaTest/doc/RSiena.bib	2020-01-15 10:26:04 UTC (rev 346)
+++ pkg/RSienaTest/doc/RSiena.bib	2020-02-16 17:03:50 UTC (rev 347)
@@ -11,6 +11,16 @@
   year={1990}
 }
 
+ at article{adamsEtAl2012,
+title = "Capturing context: {I}ntegrating spatial and social network analyses",
+journal = "Social Networks",
+volume = "34",
+number = "1",
+pages = "1--5",
+year = "2012",
+author = "{adams}, {jimi}  and Katherine Faust and Gina S. Lovasi"
+}
+
 @article{ABFX2008,
   author = {E.M. Airoldi and D.M. Blei and S.E. Fienberg and E.P. Xing},
     year={2008},
@@ -108,7 +118,7 @@
   publisher =    {\emph{In preparation}, Cambridge University Press},
   address =      {Cambridge},
   note = {In preparation},
-  year =         2019}
+  year =         2020}
 
 
 
@@ -446,8 +456,19 @@
   pages = {  44--91}
 }
 
+ at article{BhamidiBreslerSly2011,
+  title={Mixing time of exponential random graphs},
+  author={Bhamidi, Shankar and Bresler, Guy and Sly, Allan M},
+  journal={Annals of Applied Probability},
+  volume={21},
+  issue={6},
+  pages={2146--2170},
+  year={2011}
+}
 
 
+
+
 @book{Blau55,
    Author = {Blau, Peter M.},
    Title = {The Dynamics of Bureaucracy},
@@ -544,8 +565,8 @@
 pages = "1--122",
 year = "2014",
 author = "S. Boccaletti and G. Bianconi and R. Criado and C.I. del Genio
-        and J. G\'{o}mez-Garde\~{n}es and M. Romance and
-        I. Sendi\~{n}a-Nadal and Z. Wang and M. Zanin"
+        and J. G\'{o}mez-Garde{\~{n}}es and M. Romance and
+        I. Sendi{\~{n}}a-Nadal and Z. Wang and M. Zanin"
 }
 
 @article{boero2005,
@@ -568,6 +589,27 @@
    Address = {London},
    Year = {1985} }
 
+ at article{Bonacich1972a,
+  title={Factoring and weighting approaches to clique identification},
+  author={Phillip Bonacich},
+  journal={Journal of Mathematical Sociology},
+  pages={112-120},
+  volume={2},
+  year={1972}}
+
+
+ at InCollection{Bonacich1972b,
+  author =       {Phillip Bonacich},
+  title =        {A technique for analyzing overlapping memberships},
+ 	booktitle = {Sociological Methodology},
+ 	editor = { H. Costner},
+ 	pages = {176--185},
+ 	publisher = {Jossey - Bass},
+ 	address = {San Francisco},
+ 	year =  {1972}
+}
+
+
 @article{BoormanWhite1976,
   title={Social structure from multiple networks. {II. R}ole structures},
   author={Boorman, Scott A and White, Harrison C},
@@ -730,7 +772,7 @@
     ADDRESS = "New York"
  }
 
- at inbook{BowmanShenton2014,
+ at incollection{BowmanShenton2014,
 author = {Bowman, K. O. and Shenton, L. R.},
   publisher={Wiley Online Library},
 title = {Estimation: Method of Moments},
@@ -980,15 +1022,6 @@
 address = {New York}
 }
 
-
- at BOOK{CarringtonEA05,
-AUTHOR = "Peter J. {Carrington} and John {Scott} and Stanley {Wasserman}",
-TITLE = "Models and methods in social network analysis",
-PUBLISHER = "Cambridge University Press",
-YEAR = "2005",
-ADDRESS = "New York"
-}
-
 @article{CH56,
 author ={Dorwin Cartwright and Frank Harary},
 year = 1956,
@@ -1005,7 +1038,7 @@
   year={2011}
 }
 
- at inbook{ChauFu2015,
+ at incollection{ChauFu2015,
     author="Chau, Marie and Fu, Michael C.",
     editor="Fu, Michael C",
     title="An Overview of Stochastic Approximation",
@@ -1300,6 +1333,14 @@
   year={1976}
 }
 
+ at article{BVW2015,
+title={Examining the literature on ``Networks in Space and in Time.'' {A}n introduction},
+author={De Benedictis, Luca and Vitale, Maria Prosperina and Wasserman, Stanley},
+volume={3},
+journal={Network Science},
+year={2015},
+pages={1--17}}
+
 @article{deFederico2003,
 author = {de la R\'{u}a, Ainhoa},
 title = {La din\'{a}mica de las redes de amistad. La elecci\'{o}n de amigos
@@ -1872,6 +1913,13 @@
 PAGES = "289--314"
 }
 
+ at book{Fishman1996,
+  title={Monte Carlo: Concepts, Algorithms, and Applications},
+  author={Fishman, George S.},
+  year={1996},
+  publisher={Springer},
+  address={New York}
+}
 
 @InCollection{Flap2002,
   author =       {Henk Flap},
@@ -2039,12 +2087,12 @@
 PAGES = "167--189"
 }
 
- at article{FritzEtAl2019,
+ at article{FritzEtAl2020,
   title={Tempus Volat, Hora Fugit -- A Survey of Dynamic Network Models
        in Discrete and Continuous Time},
   author={Fritz, Cornelius and Lebacher, Michael and Kauermann, G{\"o}ran},
   journal={Statistica Neerlandica},
-  year={2019}
+  year={2020}
 }
 
 @article{FujimotoEA2017,
@@ -2065,7 +2113,7 @@
   issue={3},
   journal={Network Science},
   year={2018},
-    pages={370–395}
+    pages={370--395}
 }
 
 
@@ -2828,6 +2876,15 @@
 ADDRESS = "New York"
 }
 
+ at article{HLPS2017,
+  author = {James Hollway and Alessandro Lomi and Francesca Pallotti and Christoph Stadtfeld},
+  title={Multilevel social spaces: {T}he network dynamics of organizational fields},
+  journal={Network Science},
+  year=2017,
+  pages={187--212},
+   volume= {5}
+}
+
 @article{Hoff2005,
   author = {Peter Hoff},
   title={Bilinear mixed-effects models for dyadic data},
@@ -3519,7 +3576,7 @@
 title = {Multilayer networks},
 volume = {2},
 pages = {203--271},
-year = {2014}
+year = {2014},
 journal = {Journal of Complex Networks}
 }
 
@@ -4849,6 +4906,19 @@
  year = {2001}
 }
 
+ at article{MoodyWhite2003,
+ author = {James Moody and Douglas R. White},
+ journal = {American Sociological Review},
+ issue = {1},
+ pages = {103--127},
+ title = {Structural Cohesion and Embeddedness:
+            {A} Hierarchical Concept of Social Groups},
+ volume = {68},
+ year = {2003}
+}
+
+
+
 @article{Moran1950,
   title={Notes on continuous stochastic phenomena},
   author={Moran, Patrick A.P.},
@@ -5064,7 +5134,7 @@
 year = {2017}
 }
 
- at Inbook{Niezink2018,
+ at incollection{Niezink2018,
 author="Niezink, Nynke M. D. and Snijders, Tom A. B.",
 editor="van Montfort, Kees and Oud, Johan H.L. and Voelkle, Manuel C.",
 title="Continuous-Time Modeling of Panel Data with Network Structure",
@@ -5205,7 +5275,8 @@
 @article{OsgoodEA2013,
   title={Peers and the emergence of alcohol use: {I}nfluence and selection processes
             in adolescent friendship networks},
-  author={Osgood, D Wayne and Ragan, Daniel T and Wallace, Lacey and Gest, Scott D and Feinberg, Mark E and Moody, James},
+  author={Osgood, D Wayne and Ragan, Daniel T and Wallace, Lacey and
+  ``Gest, Scott D and Feinberg, Mark E and Moody, James},
   journal={Journal of Research on Adolescence},
   volume={23},
   issue={3},
@@ -5583,7 +5654,7 @@
     author = {{R Core Team}},
     organization = {R Foundation for Statistical Computing},
     address = {Vienna, Austria},
-    year = {2019},
+    year = {2020},
     url = {https://www.R-project.org/},
   }
 
@@ -5662,7 +5733,7 @@
 @Article{Rapoport1953a,
   author =       {Anatol Rapoport},
   title =        {Spread of information through a population with
-socio-structural bias: I. Assumption of transitivity},
+socio-structural bias: I. {A}ssumption of transitivity},
   journal =      {Bulletin of Mathematical Biophysics},
   year =         1953,
   volume =   15,
@@ -5671,7 +5742,7 @@
 @Article{Rapoport1953b,
   author =       {Anatol Rapoport},
   title =        {Spread of information through a population with
-socio-structural bias:  II. Various models with partial transitivity},
+socio-structural bias:  {II.} {V}arious models with partial transitivity},
   journal =      {Bulletin of Mathematical Biophysics},
   year =         1953,
   volume =   15,
@@ -6211,8 +6282,27 @@
  year=2007,
 }
 
+ at article{SchweinbergerStewart2020,
+  title={Concentration and consistency results for canonical and curved exponential-family models of random graphs},
+  author={Schweinberger, Michael and Stewart, Jonathan},
+  journal={The Annals of Statistics},
+  pages={accepted for publication},
+  year={2020}
+}
 
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/rsiena -r 347


More information about the Rsiena-commits mailing list