[Rsiena-commits] r333 - in pkg: RSiena RSiena/man RSienaTest RSienaTest/doc RSienaTest/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 23 15:03:21 CET 2018


Author: tomsnijders
Date: 2018-03-23 15:03:19 +0100 (Fri, 23 Mar 2018)
New Revision: 333

Modified:
   pkg/RSiena/ChangeLog
   pkg/RSiena/DESCRIPTION
   pkg/RSiena/man/RSiena-package.Rd
   pkg/RSiena/man/siena07.Rd
   pkg/RSiena/man/sienaDependent.Rd
   pkg/RSienaTest/ChangeLog
   pkg/RSienaTest/DESCRIPTION
   pkg/RSienaTest/doc/RSiena.bib
   pkg/RSienaTest/doc/RSiena_Manual.pdf
   pkg/RSienaTest/doc/RSiena_Manual.tex
   pkg/RSienaTest/doc/influenceTable_s_drinking.png
   pkg/RSienaTest/man/RSiena-package.Rd
   pkg/RSienaTest/man/siena07.Rd
   pkg/RSienaTest/man/sienaDataCreateFromSession.Rd
   pkg/RSienaTest/man/sienaDependent.Rd
Log:
Version 1.2-10; very small changes.

Modified: pkg/RSiena/ChangeLog
===================================================================
--- pkg/RSiena/ChangeLog	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSiena/ChangeLog	2018-03-23 14:03:19 UTC (rev 333)
@@ -1,3 +1,8 @@
+2018-03-23 R-Forge Revision 333, packages version 1.2-10.
+Changes in RSiena and RSienaTest:
+   * Example in help file siena07 for accessing generated networks for ML.
+
+
 2018-03-21 R-Forge Revision 332, packages version 1.2-9.
 Changes in RSiena and RSienaTest:
    * model/effects/generic: Remove const from some of the value methods (as

Modified: pkg/RSiena/DESCRIPTION
===================================================================
--- pkg/RSiena/DESCRIPTION	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSiena/DESCRIPTION	2018-03-23 14:03:19 UTC (rev 333)
@@ -1,8 +1,8 @@
 Package: RSiena
 Type: Package
 Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.2-9
-Date: 2018-03-21
+Version: 1.2-10
+Date: 2018-03-23
 Author: Ruth Ripley, Krists Boitmanis, Tom A.B. Snijders, Felix Schoenenberger
 Depends: R (>= 2.15.0), utils
 Imports: Matrix, tcltk, lattice, parallel, MASS, methods

Modified: pkg/RSiena/man/RSiena-package.Rd
===================================================================
--- pkg/RSiena/man/RSiena-package.Rd	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSiena/man/RSiena-package.Rd	2018-03-23 14:03:19 UTC (rev 333)
@@ -44,8 +44,8 @@
   \tabular{ll}{
     Package: \tab RSiena\cr
     Type: \tab Package\cr
-    Version: \tab 1.2-8\cr
-    Date: \tab 2018-03-21\cr
+    Version: \tab 1.2-10\cr
+    Date: \tab 2018-03-23\cr
     Depends: \tab R (>= 3.0.0)\cr
     Imports: \tab Matrix\cr
     Suggests: \tab tcltk, network, codetools, lattice, MASS, parallel,

Modified: pkg/RSiena/man/siena07.Rd
===================================================================
--- pkg/RSiena/man/siena07.Rd	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSiena/man/siena07.Rd	2018-03-23 14:03:19 UTC (rev 333)
@@ -222,5 +222,49 @@
 ans4 <- siena07(myalgorithm, data=mydata, effects=myeff, batch=TRUE, cl = cl)
 stopCluster(cl)
     }
+# Accessing simulated networks for ML ------------------------------------------
+# The following is an example for accessing the simulated networks for ML,
+# which makes sense only if there are some missing tie variables;
+# observed tie variables are identically simulated at the moment of observation,
+# missing tie variable are imputed in a model-based way.
+mat1 <- matrix(c(0,0,1,1,
+                 1,0,0,0,
+                 0,0,0,1,
+                 0,1,0,0),4,4, byrow=TRUE)
+mat2 <- matrix(c(0,1,1,1,
+                 1,0,0,0,
+                 0,0,0,1,
+                 0,0,1,0),4,4, byrow=TRUE)
+mat3 <- matrix(c(0,1,0,1,
+                 1,0,0,0,
+                 0,0,0,0,
+                 NA,1,1,0),4,4, byrow=TRUE)
+mats <- array(c(mat1,mat2,mat3), dim=c(4,4,3))
+net <- sienaDependent(mats, allowOnly=FALSE)
+sdat <- sienaDataCreate(net)
+alg <- sienaAlgorithmCreate(maxlike=TRUE, nsub=3, n3=100, seed=1234)
+effs <- getEffects(sdat)
+\dontrun{
+(ans <- siena07(alg, data=sdat, effects=effs, returnDeps=TRUE))
+# See manual Section 9.1 for information about the following functions
+edges.to.adj <- function(x,n){
+# create empty adjacency matrix
+    adj <- matrix(0, n, n)
+# put edge values in desired places
+    adj[x[, 1:2]] <- x[, 3]
+    adj
 }
+the.edge <- function(x,n,h,k){
+    edges.to.adj(x,n)[h,k]
+}
+# Now show the results
+n <- 4
+ego <- rep.int(1:n,n)
+alter <- rep(1:n, each=n)
+ones <- sapply(1:n^2, function(i)
+    {mean(sapply(ans$sims, function(x){the.edge(x[[1]][[2]],n,ego[i],alter[i])}))})
+cbind(ego,alter,ones)
+matrix(ones,n,n)
+    }
+}
 \keyword{models}

Modified: pkg/RSiena/man/sienaDependent.Rd
===================================================================
--- pkg/RSiena/man/sienaDependent.Rd	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSiena/man/sienaDependent.Rd	2018-03-23 14:03:19 UTC (rev 333)
@@ -59,7 +59,7 @@
   \item{nodeSet}{Character string with name(s) of node set(s)}
   \item{allowOnly}{The value of the \code{allowOnly} parameter}
 }
-\references{See \url{http://www.stats.ox.ac.uk/siena/}}
+\references{See \url{http://www.stats.ox.ac.uk/~snijders/siena/} .}
 \author{Ruth Ripley and Tom A.B. Snijders}
 \seealso{\code{\link{sienaDataCreate}}, \code{\link{sienaNodeSet}},
    \code{\link{sienaDataConstraint}}}

Modified: pkg/RSienaTest/ChangeLog
===================================================================
--- pkg/RSienaTest/ChangeLog	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/ChangeLog	2018-03-23 14:03:19 UTC (rev 333)
@@ -1,3 +1,8 @@
+2018-03-23 R-Forge Revision 333, packages version 1.2-10.
+Changes in RSiena and RSienaTest:
+   * Example in help file siena07 for accessing generated networks for ML.
+
+
 2018-03-21 R-Forge Revision 332, packages version 1.2-9.
 Changes in RSiena and RSienaTest:
    * model/effects/generic: Remove const from some of the value methods (as

Modified: pkg/RSienaTest/DESCRIPTION
===================================================================
--- pkg/RSienaTest/DESCRIPTION	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/DESCRIPTION	2018-03-23 14:03:19 UTC (rev 333)
@@ -1,8 +1,8 @@
 Package: RSienaTest
 Type: Package
 Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.2-9
-Date: 2018-03-20
+Version: 1.2-10
+Date: 2018-03-23
 Author: Ruth Ripley, Krists Boitmanis, Tom A.B. Snijders, Felix Schoenenberger
 Depends: R (>= 2.15.0), utils
 Imports: Matrix, tcltk, lattice, parallel, MASS, RUnit, methods

Modified: pkg/RSienaTest/doc/RSiena.bib
===================================================================
--- pkg/RSienaTest/doc/RSiena.bib	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/doc/RSiena.bib	2018-03-23 14:03:19 UTC (rev 333)
@@ -5173,7 +5173,7 @@
     Institution={Oxford: University of Oxford, Department of Statistics;
 Nuffield College},
     Year={2016},
-    url = {http://www.stats.ox.ac.uk/siena/}
+    url = {http://www.stats.ox.ac.uk/~snijders/siena/}
 }
 
 
@@ -5184,7 +5184,7 @@
     Institution={Oxford: University of Oxford, Department of Statistics;
 Nuffield College},
     Year={2017},
-    url = {http://www.stats.ox.ac.uk/siena/}
+    url = {http://www.stats.ox.ac.uk/~snijders/siena/}
 }
 
 @Techreport{SienaManual,
@@ -5194,7 +5194,7 @@
     Institution={Oxford: University of Oxford, Department of Statistics;
 Nuffield College},
     Year={2017},
-    url = {http://www.stats.ox.ac.uk/siena/}
+    url = {http://www.stats.ox.ac.uk/~snijders/siena/}
 }
 
 

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

Modified: pkg/RSienaTest/doc/RSiena_Manual.tex
===================================================================
--- pkg/RSienaTest/doc/RSiena_Manual.tex	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/doc/RSiena_Manual.tex	2018-03-23 14:03:19 UTC (rev 333)
@@ -14407,9 +14407,8 @@
 Changes in RSienaTest:
 \begin{itemize}
    \item new function \sfn{extract.posteriorMeans} for \sfn{sienaBayes} results.
-   \item Add \texttt{z{\$fix}} to \sfn{sienaBayes} object, and 
-   use \texttt{!z{\$fix}} in check of maximum
-     estimated parameter value after initialization.
+   \item Restrict check of maximum
+     estimated parameter value after initialization to non-fixed effects.
    \item Correct construction of groupwise effects object in \sfn{sienaBayes} 
     so that this
      will work also when evaluation effects for density and/or reciprocity are

Modified: pkg/RSienaTest/doc/influenceTable_s_drinking.png
===================================================================
(Binary files differ)

Modified: pkg/RSienaTest/man/RSiena-package.Rd
===================================================================
--- pkg/RSienaTest/man/RSiena-package.Rd	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/man/RSiena-package.Rd	2018-03-23 14:03:19 UTC (rev 333)
@@ -46,8 +46,8 @@
   \tabular{ll}{
     Package: \tab RSienaTest\cr
     Type: \tab Package\cr
-    Version: \tab 1.2-8\cr
-    Date: \tab 2018-03-21\cr
+    Version: \tab 1.2-10\cr
+    Date: \tab 2018-03-23\cr
     Depends: \tab R (>= 3.0.0)\cr
     Imports: \tab Matrix\cr
     Suggests: \tab tcltk, network, codetools, lattice, MASS, parallel,

Modified: pkg/RSienaTest/man/siena07.Rd
===================================================================
--- pkg/RSienaTest/man/siena07.Rd	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/man/siena07.Rd	2018-03-23 14:03:19 UTC (rev 333)
@@ -101,8 +101,8 @@
  In the case of using multiple processors, there are two options for telling
  \code{siena07} to use them. By specifying the options \code{useCluster}, \code{nbrNodes},
  \code{clusterString} and \code{initC}, \code{siena07} will create a
- \link[parallel:makeCluster]{cluster object} that will be used by the
- \link[parallel:parallel]{parallel} package. After finishing the estimation procedure,
+ \code{cluster object} that will be used by the
+ \code{parallel} package. After finishing the estimation procedure,
  \code{siena07} will automatically stop the cluster. Alternatively, instead of
  having the function to create a cluster, the user may provide its own by
  specifying the option \code{cl}, similar to what the boot function does in
@@ -236,5 +236,49 @@
 ans4 <- siena07(myalgorithm, data=mydata, effects=myeff, batch=TRUE, cl = cl)
 stopCluster(cl)
     }
+# Accessing simulated networks for ML ------------------------------------------
+# The following is an example for accessing the simulated networks for ML,
+# which makes sense only if there are some missing tie variables;
+# observed tie variables are identically simulated at the moment of observation,
+# missing tie variable are imputed in a model-based way.
+mat1 <- matrix(c(0,0,1,1,
+                 1,0,0,0,
+                 0,0,0,1,
+                 0,1,0,0),4,4, byrow=TRUE)
+mat2 <- matrix(c(0,1,1,1,
+                 1,0,0,0,
+                 0,0,0,1,
+                 0,0,1,0),4,4, byrow=TRUE)
+mat3 <- matrix(c(0,1,0,1,
+                 1,0,0,0,
+                 0,0,0,0,
+                 NA,1,1,0),4,4, byrow=TRUE)
+mats <- array(c(mat1,mat2,mat3), dim=c(4,4,3))
+net <- sienaDependent(mats, allowOnly=FALSE)
+sdat <- sienaDataCreate(net)
+alg <- sienaAlgorithmCreate(maxlike=TRUE, nsub=3, n3=100, seed=1234)
+effs <- getEffects(sdat)
+\dontrun{
+(ans <- siena07(alg, data=sdat, effects=effs, returnDeps=TRUE))
+# See manual Section 9.1 for information about the following functions
+edges.to.adj <- function(x,n){
+# create empty adjacency matrix
+    adj <- matrix(0, n, n)
+# put edge values in desired places
+    adj[x[, 1:2]] <- x[, 3]
+    adj
 }
+the.edge <- function(x,n,h,k){
+    edges.to.adj(x,n)[h,k]
+}
+# Now show the results
+n <- 4
+ego <- rep.int(1:n,n)
+alter <- rep(1:n, each=n)
+ones <- sapply(1:n^2, function(i)
+    {mean(sapply(ans$sims, function(x){the.edge(x[[1]][[2]],n,ego[i],alter[i])}))})
+cbind(ego,alter,ones)
+matrix(ones,n,n)
+    }
+}
 \keyword{models}

Modified: pkg/RSienaTest/man/sienaDataCreateFromSession.Rd
===================================================================
--- pkg/RSienaTest/man/sienaDataCreateFromSession.Rd	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/man/sienaDataCreateFromSession.Rd	2018-03-23 14:03:19 UTC (rev 333)
@@ -99,12 +99,16 @@
 \seealso{ \code{\link{sienaDataCreate}}, \code{\link{siena}}}
 \examples{
 \dontrun{
+# Go to the directory that has the files needed here,
+# but make sure to go back to the current directory at the end:
 thiswd <- getwd()
-pd <- system.file("examples", package="RSienaTest")
+# The directory where we want to go for the data files:
+(pd <- system.file("examples", package="RSienaTest"))
 setwd(pd)
+# The file we need:
 (filePath <- system.file("examples", "sienafreshman.csv", package="RSienaTest"))
-# In this path there are also other .csv files with accompanying data sets.
 session <- sienaDataCreateFromSession(filePath)
+# In directory pd there are also other .csv files with accompanying data sets.
 (mydata <- session$mydata)
 (myeff <- session$myeff)
 setwd(thiswd)

Modified: pkg/RSienaTest/man/sienaDependent.Rd
===================================================================
--- pkg/RSienaTest/man/sienaDependent.Rd	2018-03-21 09:25:55 UTC (rev 332)
+++ pkg/RSienaTest/man/sienaDependent.Rd	2018-03-23 14:03:19 UTC (rev 333)
@@ -59,7 +59,7 @@
   \item{nodeSet}{Character string with name(s) of node set(s)}
   \item{allowOnly}{The value of the \code{allowOnly} parameter}
 }
-\references{See \url{http://www.stats.ox.ac.uk/siena/}}
+\references{See \url{http://www.stats.ox.ac.uk/~snijders/siena/} .}
 \author{Ruth Ripley and Tom A.B. Snijders}
 \seealso{\code{\link{sienaDataCreate}}, \code{\link{sienaNodeSet}},
    \code{\link{sienaDataConstraint}}}



More information about the Rsiena-commits mailing list