[Rsiena-commits] r66 - in pkg: RSiena RSiena/R RSienaTest RSienaTest/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 17 15:13:58 CET 2010


Author: ripleyrm
Date: 2010-03-17 15:13:57 +0100 (Wed, 17 Mar 2010)
New Revision: 66

Modified:
   pkg/RSiena/R/simstatsc.r
   pkg/RSiena/changeLog
   pkg/RSienaTest/R/simstatsc.r
   pkg/RSienaTest/changeLog
Log:


Modified: pkg/RSiena/R/simstatsc.r
===================================================================
--- pkg/RSiena/R/simstatsc.r	2010-03-17 13:38:06 UTC (rev 65)
+++ pkg/RSiena/R/simstatsc.r	2010-03-17 14:13:57 UTC (rev 66)
@@ -232,6 +232,8 @@
             f$depNames <- NULL
             f$groupNames <- NULL
             f$nGroup <- NULL
+            f$basicEffects <- NULL
+            f$interactionEffects <- NULL
        }
         ##browser()
         pData <- .Call('setupData', PACKAGE="RSiena",
@@ -275,13 +277,6 @@
             effects$effectPtr <- NA
             splitFactor <- factor(effects$name, levels=attr(f, "netnames"))
             myeffects <- split(effects, splitFactor)
-        }
-        else
-        {
-            myeffects <- ff$myeffects
-            returnDeps <- ff$returnDeps
-            nGroup <- ff$nGroup
-        }
         ## remove interaction effects and save till later
         basicEffects <- lapply(myeffects, function(x)
                         {
@@ -293,6 +288,18 @@
                             x[x$shortName %in% c("unspInt", "behUnspInt"), ]
                         }
                             )
+            ## store effects objects as we may need to recreate them
+            f$interactionEffects <- interactionEffects
+            f$basicEffects <- basicEffects
+        }
+        else
+        {
+            myeffects <- ff$myeffects
+            basicEffects <- ff$basicEffects
+            interactionEffects <- ff$interactionEffects
+            returnDeps <- ff$returnDeps
+            nGroup <- ff$nGroup
+        }
         ans <- .Call('effects', PACKAGE="RSiena",
                     pData, basicEffects)
         pModel <- ans[[1]][[1]]

Modified: pkg/RSiena/changeLog
===================================================================
--- pkg/RSiena/changeLog	2010-03-17 13:38:06 UTC (rev 65)
+++ pkg/RSiena/changeLog	2010-03-17 14:13:57 UTC (rev 66)
@@ -1,3 +1,13 @@
+2010-03-17 R-forge revision 66
+
+	* R/simstatsc.r: bug fix: user interaction effects did not work
+	with multiple processors.
+
+2010-03-17 R-forge revision 65 (RSienaTest only)
+
+	* src/model/ml/MLsimulation.cpp, src/model/ml/MLsimulation.ch:
+	forgotten files
+
 2010-03-16 R-forge revision 64
 
 	* data/allEffects.csv: covarBipartite egoX should have been an ego
@@ -2,3 +12,3 @@
 	effect not dyadic.
-	
+
 2010-03-15 R-forge revision 63 (RSienaTest only)

Modified: pkg/RSienaTest/R/simstatsc.r
===================================================================
--- pkg/RSienaTest/R/simstatsc.r	2010-03-17 13:38:06 UTC (rev 65)
+++ pkg/RSienaTest/R/simstatsc.r	2010-03-17 14:13:57 UTC (rev 66)
@@ -234,6 +234,8 @@
             f$depNames <- NULL
             f$groupNames <- NULL
             f$nGroup <- NULL
+            f$basicEffects <- NULL
+            f$interactionEffects <- NULL
        }
         ##browser()
         #browser()
@@ -279,43 +281,49 @@
             effects$effectPtr <- NA
             splitFactor <- factor(effects$name, levels=attr(f, "netnames"))
             myeffects <- split(effects, splitFactor)
+            ## remove interaction effects and save till later
+            basicEffects <- lapply(myeffects, function(x)
+                               {
+                                   x[!x$shortName %in% c("unspInt", "behUnspInt"), ]
+                               }
+                                   )
+            interactionEffects <- lapply(myeffects, function(x)
+                                     {
+                                         x[x$shortName %in% c("unspInt", "behUnspInt"), ]
+                                     }
+                                         )
+            ## store effects objects as we may need to recreate them
+            f$interactionEffects <- interactionEffects
+            f$basicEffects <- basicEffects
         }
         else
         {
             myeffects <- ff$myeffects
+            basicEffects <- ff$basicEffects
+            interactionEffects <- ff$interactionEffects
             returnDeps <- ff$returnDeps
             nGroup <- ff$nGroup
         }
-        ## remove interaction effects and save till later
-        basicEffects <- lapply(myeffects, function(x)
-                        {
-                            x[!x$shortName %in% c("unspInt", "behUnspInt"), ]
-                        }
-                            )
-        interactionEffects <- lapply(myeffects, function(x)
-                        {
-                            x[x$shortName %in% c("unspInt", "behUnspInt"), ]
-                        }
-                            )
         ans <- .Call('effects', PACKAGE=pkgname,
-                    pData, basicEffects)
+                     pData, basicEffects)
         pModel <- ans[[1]][[1]]
-       ## browser()
+        ## browser()
         for (i in 1:length(ans[[2]])) ## ans[[2]] is a list of lists of
             ## pointers to effects. Each list corresponds to one
             ## dependent variable
         {
             effectPtr <- ans[[2]][[i]]
             basicEffects[[i]]$effectPtr <- effectPtr
-            interactionEffects[[i]]$effect1 <-
-                basicEffects[[i]]$effectPtr[match(interactionEffects[[i]]$effect1,
-                                                  basicEffects[[i]]$effectNumber)]
-            interactionEffects[[i]]$effect2 <-
-                basicEffects[[i]]$effectPtr[match(interactionEffects[[i]]$effect2,
-                                                  basicEffects[[i]]$effectNumber)]
-            interactionEffects[[i]]$effect3 <-
-                basicEffects[[i]]$effectPtr[match(interactionEffects[[i]]$effect3,
-                                                  basicEffects[[i]]$effectNumber)]
+
+                interactionEffects[[i]]$effect1 <-
+                    basicEffects[[i]]$effectPtr[match(interactionEffects[[i]]$effect1,
+                                                      basicEffects[[i]]$effectNumber)]
+                interactionEffects[[i]]$effect2 <-
+                    basicEffects[[i]]$effectPtr[match(interactionEffects[[i]]$effect2,
+                                                      basicEffects[[i]]$effectNumber)]
+                interactionEffects[[i]]$effect3 <-
+                    basicEffects[[i]]$effectPtr[match(interactionEffects[[i]]$effect3,
+                                                      basicEffects[[i]]$effectNumber)]
         }
         ans <- .Call('interactionEffects', PACKAGE=pkgname,
                      pData, pModel, interactionEffects)
@@ -393,6 +401,7 @@
         {
             f[1:nGroup] <- NULL
         }
+
         FRANstore(f) ## store f in FRANstore
         if (initC)
         {
@@ -476,12 +485,11 @@
                                               function(x) 1:x))))
     if (z$int2==1 || nrow(callGrid) == 1)
     {
-      #   cat("theta", z$theta, "\n")
-       ans <- .Call('model', PACKAGE=pkgname,
+     ans <- .Call('model', PACKAGE=pkgname,
                      z$Deriv, f$pData, seeds,
                      fromFiniteDiff, f$pModel, f$myeffects, z$theta,
                      randomseed2, returnDeps, z$FinDiff.method, !is.null(z$cl))
-    }
+   }
     else
     {
         use <- 1:(min(nrow(callGrid), z$int2))

Modified: pkg/RSienaTest/changeLog
===================================================================
--- pkg/RSienaTest/changeLog	2010-03-17 13:38:06 UTC (rev 65)
+++ pkg/RSienaTest/changeLog	2010-03-17 14:13:57 UTC (rev 66)
@@ -1,3 +1,13 @@
+2010-03-17 R-forge revision 66
+
+	* R/simstatsc.r: bug fix: user interaction effects did not work
+	with multiple processors.
+
+2010-03-17 R-forge revision 65 (RSienaTest only)
+
+	* src/model/ml/MLsimulation.cpp, src/model/ml/MLsimulation.ch:
+	forgotten files
+
 2010-03-16 R-forge revision 64
 
 	* data/allEffects.csv: covarBipartite egoX should have been an ego



More information about the Rsiena-commits mailing list