[Rsiena-commits] r352 - in pkg/RSienaTest: . R data doc man src/model/effects
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Mar 18 18:31:27 CET 2021
Author: tomsnijders
Date: 2021-03-18 18:31:26 +0100 (Thu, 18 Mar 2021)
New Revision: 352
Modified:
pkg/RSienaTest/ChangeLog
pkg/RSienaTest/DESCRIPTION
pkg/RSienaTest/R/sienaBayes.r
pkg/RSienaTest/data/allEffects.csv
pkg/RSienaTest/doc/RSiena.bib
pkg/RSienaTest/doc/simstats0c.tex
pkg/RSienaTest/man/RSiena-package.Rd
pkg/RSienaTest/man/sienaBayes.Rd
pkg/RSienaTest/src/model/effects/EffectFactory.cpp
pkg/RSienaTest/src/model/effects/HomCovariateTransitiveTripletsEffect.cpp
Log:
Modified: pkg/RSienaTest/ChangeLog
===================================================================
--- pkg/RSienaTest/ChangeLog 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/ChangeLog 2021-03-18 17:31:26 UTC (rev 352)
@@ -1,3 +1,8 @@
+2021-03-18 R-Forge Revision 352, package version 1.2-28.
+ * New effect homXTransRecTrip
+ * Added rateParameterPosition to glueBayes, which results
+ in correct effect names for extract.posteriorMeans.
+
2020-09-16 R-Forge Revision 350, package version 1.2-27.
Changes in RSiena and RSienaTest:
* Changed requirement for tcltk to "Suggests",
Modified: pkg/RSienaTest/DESCRIPTION
===================================================================
--- pkg/RSienaTest/DESCRIPTION 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/DESCRIPTION 2021-03-18 17:31:26 UTC (rev 352)
@@ -2,8 +2,8 @@
Package: RSienaTest
Type: Package
Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.2-27
-Date: 2020-09-14
+Version: 1.2-28
+Date: 2021-03-18
Authors at R: c(person("Tom", "Snijders", role = c("cre", "aut"), email = "tom.snijders at nuffield.ox.ac.uk", comment = c(ORCID = "0000-0003-3157-4157")),
person("Christian", "Steglich", role = c("aut","ctb"), comment = c(ORCID = "0000-0002-9097-0873")),
person("Johan", "Koskinen", role = c("aut","ctb"), comment = c(ORCID = "0000-0002-6860-325X")),
Modified: pkg/RSienaTest/R/sienaBayes.r
===================================================================
--- pkg/RSienaTest/R/sienaBayes.r 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/R/sienaBayes.r 2021-03-18 17:31:26 UTC (rev 352)
@@ -1595,6 +1595,7 @@
z$int2 <- nbrNodes
z$mult <- algo$mult
algo$cconditional <- FALSE
+ startupSkip <- FALSE
if (!is.null(algo$randomSeed))
{
set.seed(algo$randomSeed)
@@ -1674,7 +1675,6 @@
else
{
nsub <- 2
- startupSkip <- FALSE
if (!is.null(prevAns))
{
if ((usePrevOnly) &
@@ -2957,6 +2957,7 @@
z$requestedEffects <- z1$requestedEffects
z$basicRate <- z1$basicRate
z$ratePositions <- z1$ratePositions
+ z$rateParameterPosition <- z1$rateParameterPosition
z$objectiveInVarying <- z1$objectiveInVarying
z$generalParametersInGroup <- z1$generalParametersInGroup
z$varyingParametersInGroup <- z1$varyingParametersInGroup
Modified: pkg/RSienaTest/data/allEffects.csv
===================================================================
--- pkg/RSienaTest/data/allEffects.csv 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/data/allEffects.csv 2021-03-18 17:31:26 UTC (rev 352)
@@ -302,6 +302,7 @@
covarNonSymmetricObjective,transitive triplets diff. xxxxxx,Number of transitive triplets diff. on xxxxxx,diffXTransTrip,TRUE,xxxxxx,,eval,FALSE,FALSE,FALSE,FALSE,FALSE,",",0,0,objective,NA,NA,0,0,0,0,,FALSE
covarNonSymmetricObjective,transitive triplets homog. xxxxxx,Number of transitive triplets homogeneous on xxxxxx,homXTransTrip,TRUE,xxxxxx,,eval,FALSE,FALSE,FALSE,FALSE,FALSE,",",0,0,objective,NA,NA,0,0,0,0,,FALSE
covarNonSymmetricObjective,transitive triplets jumping xxxxxx,Number of transitive triplets jumping xxxxxx,jumpXTransTrip,TRUE,xxxxxx,,eval,FALSE,FALSE,FALSE,FALSE,FALSE,",",0,0,objective,NA,NA,0,0,0,0,,FALSE
+covarNonSymmetricObjective,trans. rec. triads hom. xxxxxx,Number of transit. recipr. triads hom. on xxxxxx,homXTransRecTrip,TRUE,xxxxxx,,eval,FALSE,FALSE,FALSE,FALSE,FALSE,",",0,0,objective,NA,NA,0,0,0,0,,FALSE
covarNonSymmetricObjective,trans. rec. triads same xxxxxx,Number of transit. recipr. triads same on xxxxxx,sameXTransRecTrip,TRUE,xxxxxx,,eval,FALSE,FALSE,FALSE,FALSE,FALSE,",",0,0,objective,NA,NA,0,0,0,0,,FALSE
covarNonSymmetricObjective,trans. rec. triads diff. xxxxxx,Number of transit. recipr. triads diff. on xxxxxx,diffXTransRecTrip,TRUE,xxxxxx,,eval,FALSE,FALSE,FALSE,FALSE,FALSE,",",0,0,objective,NA,NA,0,0,0,0,,FALSE
covarNonSymmetricObjective,xxxxxx ego x xxxxxx alter,Sum xxxxxx ego x xxxxxx alter,egoXaltX,TRUE,xxxxxx,,eval,FALSE,FALSE,FALSE,FALSE,FALSE,",",0,0,objective,NA,NA,0,0,0,0,dyadic,FALSE
Modified: pkg/RSienaTest/doc/RSiena.bib
===================================================================
--- pkg/RSienaTest/doc/RSiena.bib 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/doc/RSiena.bib 2021-03-18 17:31:26 UTC (rev 352)
@@ -6355,7 +6355,19 @@
PAGES = "165--180"
}
+ at article{Schweinberger2020,
+ author = {Schweinberger, Michael},
+ title = {Statistical inference for continuous-time Markov
+ processes with block structure based on discrete-time network data},
+ journal = {Statistica Neerlandica},
+ volume = {74},
+ issue = {3},
+ pages = {342--362},
+ year = {2020}
+}
+
+
@article{SchweinbergerSnijders2003,
author = {Michael Schweinberger and Tom A. B. Snijders},
title = { Settings in Social Networks: A Measurement Model},
Modified: pkg/RSienaTest/doc/simstats0c.tex
===================================================================
--- pkg/RSienaTest/doc/simstats0c.tex 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/doc/simstats0c.tex 2021-03-18 17:31:26 UTC (rev 352)
@@ -57,7 +57,7 @@
\title{Simstats0c/FRAN}
\author{Ruth Ripley}
-\date{}
+\date{2013}
\maketitle
\centerline{\emph{\today}}
@@ -76,11 +76,14 @@
\section{Outstanding work}
\begin{enumerate}
\item When setting up the effects for behaviour variables, it is
- assumed that the one-mode network is non-symmetric. Should not!
+ assumed that the one-mode network is non-symmetric. Should not!\\
+Note by Tom (February 2021): I'm not sure that this still is the case.
+It should be checked.
\item Allow data values indicating structurally fixed values to be a parameter.
\item Validate things
\end{enumerate}
+
\section{Model specification}
\subsection{The data as input to \nnm{simstats0c}}
@@ -229,10 +232,10 @@
\IF{bipartite}
\STATE add \{0\} to alters
\ENDIF
-\FOR[calculate deltas and effects]{$j \in \text{alters}$ }
-\IF{out-degree of actor >= \nm{maxdegree}} (changed from = to >=, ts, 6-5-13)
-\STATE change is only permissible if there is a link to this alter, to
-change its value
+\FOR[calculate deltas and effects;
+this condition changed from = to >=, ts, 6-5-13]{$j \in \text{alters}$ }
+\IF{out-degree of actor $>=$ \nm{maxdegree}}
+\STATE change is only permissible if there is a link to this alter, to change its value
\ELSIF{link from actor to $j$ is structurally determined}
\STATE $\nnm{delta} = \{\}$
\ELSE[changes are permissible]
Modified: pkg/RSienaTest/man/RSiena-package.Rd
===================================================================
--- pkg/RSienaTest/man/RSiena-package.Rd 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/man/RSiena-package.Rd 2021-03-18 17:31:26 UTC (rev 352)
@@ -49,8 +49,8 @@
\tabular{ll}{
Package: \tab RSienaTest\cr
Type: \tab Package\cr
- Version: \tab 1.2-27\cr
- Date: \tab 2020-09-16\cr
+ Version: \tab 1.2-28\cr
+ Date: \tab 2021-03-18\cr
Depends: \tab R (>= 2.15.0)\cr
Imports: \tab Matrix, lattice, parallel, MASS, methods\cr
Suggests: \tab xtable, network, tools, codetools, utils, tcltk\cr
Modified: pkg/RSienaTest/man/sienaBayes.Rd
===================================================================
--- pkg/RSienaTest/man/sienaBayes.Rd 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/man/sienaBayes.Rd 2021-03-18 17:31:26 UTC (rev 352)
@@ -127,9 +127,9 @@
for each chain sample.}
\item{nImproveMH}{Number of iterations per improveMH step.
If \code{nImproveMH=0}, no improveMH steps at all.}
- \item{targetMHProb}{Desired proportion of acceptances in MH steps.
+ \item{targetMHProb}{Desired proportion of acceptances in MH steps.
This can be one number, or a vector of two numbers. In the latter case,
- the first number applies to the MH steps per group (for each group),
+ the first number applies to the MH steps per group (for each group),
the second to the MH steps for the constant parameters ("eta").}
\item{lengthPhase1}{Only used for frequentist estimation or
\code{incidentalBasicRates}:
@@ -274,11 +274,14 @@
When the procedure seems to diverge, and for very small groups, it is
advisable to use smaller values of the parameters \code{initgainGlobal}
- and \code{initgainGroupwise}.\cr
+ and \code{initgainGroupwise}.
+
\code{glueBayes(z1,z2)} combines two existing \code{sienaBayesFit} objects
with the same data and model specifications (this is not entirely
- checked) into one. This is intended to be used when \code{z2} was produced
- by calling \code{sienaBayes} with \code{prevBayes=z1}.\cr
+ checked) into one by putting \code{z2} after \code{z1}.
+ This is intended to be used when \code{z2} was produced
+ by calling \code{sienaBayes} with \code{prevBayes=z1}.
+
For the function \code{\link{print.sienaEffects}}, the options
\code{includeRandoms=TRUE} and \code{dropRates=TRUE} are meant to be useful
especially for effects objects used for \code{sienaBayes}.
Modified: pkg/RSienaTest/src/model/effects/EffectFactory.cpp
===================================================================
--- pkg/RSienaTest/src/model/effects/EffectFactory.cpp 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/src/model/effects/EffectFactory.cpp 2021-03-18 17:31:26 UTC (rev 352)
@@ -553,6 +553,10 @@
{
pEffect = new SameCovariateTransitiveReciprocatedTripletsEffect(pEffectInfo, false);
}
+ else if (effectName == "homXTransRecTrip")
+ {
+ pEffect = new HomCovariateTransitiveTripletsEffect(pEffectInfo, true);
+ }
else if (effectName == "inPopX")
{
string networkName = pEffectInfo->variableName();
Modified: pkg/RSienaTest/src/model/effects/HomCovariateTransitiveTripletsEffect.cpp
===================================================================
--- pkg/RSienaTest/src/model/effects/HomCovariateTransitiveTripletsEffect.cpp 2020-09-18 14:27:31 UTC (rev 351)
+++ pkg/RSienaTest/src/model/effects/HomCovariateTransitiveTripletsEffect.cpp 2021-03-18 17:31:26 UTC (rev 352)
@@ -30,10 +30,9 @@
*/
HomCovariateTransitiveTripletsEffect::HomCovariateTransitiveTripletsEffect(
- const EffectInfo * pEffectInfo, bool reciprocal) :
+ const EffectInfo * pEffectInfo, bool reciprocal) :
CovariateDependentNetworkEffect(pEffectInfo)
{
-// currently not used:
{
this->lreciprocal = reciprocal;
}
@@ -46,8 +45,8 @@
int alter) const
{
// If we are introducing a tie from the ego i to the alter j, then each
- // two-path from i to j via h with v_i = v_h != v_j contributes one unit;
- // in addition, each in-star i -> h <- j with v_i = v_j != v_h
+ // two-path from i to j via h with v_i = v_h = v_j contributes one unit;
+ // in addition, each in-star i -> h <- j with v_i = v_j = v_h
// also contributes one unit.
// This number is not stored in a table and is calculated from scratch.
@@ -63,41 +62,44 @@
iter.valid();
iter.next())
{
-
-// HERE THE COVAR OF THE MEDIATING ACTOR IS IDENTIFIED!!!!
-
// Get the receiver of the outgoing tie.
int h = iter.actor();
- // in 2-stars:
- if (fabs( this->value(h) - this->value( this->ego() ) ) < EPSILON &&
- pNetwork->tieValue(alter, h) >= 1)
+ if (this->lreciprocal) // homXTransRecTrip
{
- contribution1++ ;
+ if (fabs( this->value(h) - this->value( this->ego()) ) < EPSILON)
+ {
+ // in 2-stars:
+ if ( (pNetwork->tieValue(alter, h) >= 1) &&
+ (pNetwork->tieValue(this->ego(), h) >= 1) )
+ {
+ contribution1++ ;
+ }
+ // 2-paths:
+ if ( (pNetwork->tieValue(h, alter) >= 1) &&
+ (pNetwork->tieValue(this->ego(), alter) >= 1) )
+ {
+ contribution1++ ;
+ }
+ }
}
- }
- }
- else
- {
- for (IncidentTieIterator iter = pNetwork->outTies(this->ego());
- iter.valid();
- iter.next())
- {
- // Get the receiver of the outgoing tie.
- int h = iter.actor();
- // 2-paths:
- if (fabs(this->value(h) - this->value(this->ego())) < EPSILON &&
- pNetwork->tieValue(h, alter) >= 1)
+ else // homXTransTrip
{
- contribution1++ ;
+ if (fabs( this->value(h) - this->value( this->ego()) ) < EPSILON)
+ {
+ // in 2-stars:
+ if (pNetwork->tieValue(alter, h) >= 1)
+ {
+ contribution1++ ;
+ }
+ // 2-paths:
+ if (pNetwork->tieValue(h, alter) >= 1)
+ {
+ contribution1++ ;
+ }
+ }
}
}
}
-
-
-
-
-
-
return contribution1;
}
@@ -113,8 +115,10 @@
int statistic = 0;
const Network * pNetwork = this->pNetwork();
- if (!this->missing(this->ego()) && !this->missing(alter) &&
- fabs(this->value(alter) - this->value(this->ego())) < EPSILON)
+ if ( (!this->missing(this->ego())) && (!this->missing(alter)) &&
+ (fabs(this->value(alter) - this->value(this->ego())) < EPSILON) &&
+ ((!this->lreciprocal) ||
+ (pNetwork->tieValue(alter, this->ego()) >= 1) ) )
{
// The following probably can be done more efficiently
// using CommonNeighborIterator.
More information about the Rsiena-commits
mailing list