Skip to content

Commit

Permalink
Merge pull request #72 from snlab-nl/develop
Browse files Browse the repository at this point in the history
Version 1.3-22
  • Loading branch information
TomSnijders authored May 12, 2023
2 parents 8833d8a + ad64173 commit 91b982e
Show file tree
Hide file tree
Showing 127 changed files with 1,050 additions and 626 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Encoding: UTF-8
Package: RSiena
Type: Package
Title: Siena - Simulation Investigation for Empirical Network Analysis
Version: 1.3.20
Date: 2023-04-22
Version: 1.3.22
Date: 2023-05-11
Authors@R: c(person("Tom A.B.", "Snijders", role = c("cre", "aut"), email = "tom.snijders@nuffield.ox.ac.uk", comment = c(ORCID = "0000-0003-3157-4157")),
person("Ruth", "Ripley", role = "aut"),
person("Krists", "Boitmanis", role = c( "aut","ctb")),
Expand Down
24 changes: 24 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# RSiena 1.3.22

##

2023-05-11

## Changes in RSiena:
### Coding:
* Corrected and cleaned up virtual definitions in `AlterFunction` and its
descendants, in particular `CovariateNetworkAlterFunction`.
* Added `const` to virtual specification of `value` in `AlterFunction.h`
and all of its descendants.
* Replaced ambiguous call to `std::abs` in `AbsDiffFunction.cpp`.
### New functionality:
* For one-mode networks, new model options `DOUBLESTEP25`, `DOUBLESTEP50`,
`DOUBLESTEP75`, `DOUBLESTEP100`.
### Corrections:
* The first item in "Coding" implies correction of several distance-2 network
effects such as `altDist2`, `totDist2` and `altInDist2`.
* In `sienaAlgorithmCreate`, changed default `prML=2` back to `prML=1`;
stop if Maximum Likelihood estimation is attempted for a data set
containing more than one dependent variable
with `prML=2` (implemented in `initializeFRAN.r`).

# RSiena 1.3.20

##
Expand Down
11 changes: 11 additions & 0 deletions R/initializeFRAN.r
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,17 @@ initializeFRAN <- function(z, x, data, effects, prevAns=NULL, initC,

## split and rejoin both versions before continuing
depvarnames <- names(data[[1]]$depvars)

if (x$maxlike & (length(depvarnames) > 1))
{
if(x$pridg + x$prcdg + x$prper + x$pripr + x$prdpr + x$prirms +
x$prdrms < 1)
{
cat("Maximum likelihood estimation with more than one dependent variable\n")
cat("is impossible with prML=2. Try prML=1.\n")
stop("Impossible algorithm-data combination.")
}
}

effects1 <- split(requestedEffects, requestedEffects$name)
effects1order <- match(c(depvarnames, "sde"), names(effects1))
Expand Down
2 changes: 1 addition & 1 deletion R/printDataReport.r
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ DataReport <- function(z, x, f)
{
Report(sprintf("Network %d %s :", i, oneModeNames[i]), outf)
}
Report(sprintf(" %s\n",ModelTypeStrings(z$modelType[i])), outf)
Report(sprintf(" %s \n",ModelTypeStrings(z$modelType[i])), outf)
}
if (any(z$modelType != x$modelType))
{
Expand Down
23 changes: 15 additions & 8 deletions R/sienaModelCreate.r
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sienaModelCreate <- function(fn,
maxlike=FALSE, gmm=FALSE, diagonalize=0.2*!maxlike,
condvarno=0, condname='',
firstg=0.2, reduceg=0.5, cond=NA, findiff=FALSE, seed=NULL,
prML=2,
prML=1,
# pridg=0.05, prcdg=0.05, prper=0.2, pripr=0.3, prdpr=0.3,
# prirms=0.05, prdrms=0.05,
maximumPermutationLength=40,
Expand All @@ -31,7 +31,7 @@ sienaModelCreate <- function(fn,
if (maxlike && (!is.null(MaxDegree)))
{
warning("maxlike and MaxDegree are incompatible")
}
}
if (is.null(projname) | checking)
{
model$projname <- tempfile("Siena")
Expand Down Expand Up @@ -122,10 +122,13 @@ sienaModelCreate <- function(fn,

if (!is.null(modelType))
{
if (any(!(modelType %in% 1:6)))
if (any(!(modelType %in% 1:10)))
{
stop('modelType can only have integer values from 1 to 10\n')
}
if ((maxlike) & (any(modelType %in% 7:10)))
{
warning('modelType can only have values from 1 to 6; other values changed to 1\n')
model$modelType[!(modelType %in% 1:6)] <- 1
stop('Double step model type incompatible with maximum likelihood estimation')
}
if (any(is.null(names(modelType))))
{
Expand Down Expand Up @@ -171,7 +174,7 @@ sienaModelCreate <- function(fn,
model$prdrms <- 0.05 # delete random missing
# prob(move) = 0
}
else # prML == 2 new default
else # prML == 2
{
model$pridg <- 0.05 # insert diagonal
model$prcdg <- 0.05 # cancel diagonal
Expand Down Expand Up @@ -232,14 +235,18 @@ sienaAlgorithmCreate <- sienaModelCreate

##@ModelTypeStrings DataCreate
ModelTypeStrings <- function(i){
ifelse(((i %in% 1:6) && (!is.null(i))),
ifelse(((i >= 1) && (i <= 8) && (!is.null(i))),
switch(i,
"Standard actor-oriented model",
"Forcing model",
"Initiative model",
"Pairwise forcing model",
"Pairwise mutual model",
"Pairwise joint model"), "")
"Pairwise joint model",
"Double Step Model 0.25",
"Double Step Model 0.50",
"Double Step Model 0.75",
"Double Step Model 1.00"), "")
}

##@BehaviorModelTypeStrings DataCreate
Expand Down
8 changes: 4 additions & 4 deletions R/sienaprint.r
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ print.sienaAlgorithm <- function(x, ...)
}
for (i in 1:length(x$modelType))
{
cat(sprintf(" %s: %d %s\n", names(x$modelType)[i], (x$modelType)[i],
cat(sprintf(" %s: %d %s \n", names(x$modelType)[i], (x$modelType)[i],
ModelTypeStrings(x$modelType[i])))
}
}
Expand Down Expand Up @@ -968,7 +968,7 @@ sienaFitThetaTable <- function(x, fromBayes=FALSE, tstat=FALSE, groupOnly=0, nfi
pp <- pp + nrates
}
else
{
{
pp <- sum(x$requestedEffects$include==TRUE)
xp <- pp - sum(x$requestedEffects$type=="gmm")
pp <- xp + nrates
Expand Down Expand Up @@ -1092,10 +1092,10 @@ sienaFitThetaTable <- function(x, fromBayes=FALSE, tstat=FALSE, groupOnly=0, nfi
ses <- sqrt(diag(x$covtheta))
ses[x$fixed] <- NA
}
else
else
{
ses <- sqrt(diag(x$covtheta))
ses[x$fixed[-which(x$requestedEffects$type=="gmm")]] <- NA
ses[x$fixed[-which(x$requestedEffects$type=="gmm")]] <- NA
}
}
if (fromBayes)
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Networks here are understood as entire (complete) networks, not as personal (ego
it is assumed that a set of nodes (social actors) is given, and all ties (links) between these nodes are known -
except perhaps for a moderate amount of missing data.
The name SIENA stands for Simulation Investigation for Empirical Network Analysis.
The R package is called RSiena; there also is the development package RSienaTest,
available from R-Forge.
The R package is called RSiena.

## Installation

Expand Down Expand Up @@ -105,7 +104,7 @@ The development version of RSiena can be similarly installed as:

To cite the RSiena package in publications use:

> Ruth M. Ripley, Tom A. B. Snijders, Zsofia Boda, Andras Voros, and Paulina Preciado(2023). Manual
> Ruth M. Ripley, Tom A. B. Snijders, Zsofia Boda, Andras Voros, and Paulina Preciado (2023). Manual
> for Siena version 4.0. R package version 1.3.19.
> https://www.cran.r-project.org/web/packages/RSiena/.
Expand All @@ -117,7 +116,7 @@ A BibTeX entry for LaTeX users is
author = {Ruth M. Ripley and Tom A. B. Snijders and Zsofia B'{o}da and Andr'{a}s V"{o}r"{o}s and Paulina Preciado},
year = {2023},
institution = {Oxford: University of Oxford, Department of Statistics; Nuffield College},
note = {R package version 1.3.19. https://www.cran.r-project.org/web/packages/RSiena/},
note = {R package version 1.3.22. https://www.cran.r-project.org/web/packages/RSiena/},
}
```

Expand Down
Loading

0 comments on commit 91b982e

Please sign in to comment.