Estimates parameters in a Siena model using method of moments, based on direct
simulation, conditional or otherwise; or using Maximum Likelihood by MCMC
simulation. Estimation is done using a Robbins-Monro algorithm. Note that
the data and particular model to be used
must be passed in using named arguments as the ...
,
and the specification for the algorithm must be passed on as x, which is
a sienaAlgorithm
object as produced by
sienaAlgorithmCreate
(see examples).
siena07(x, batch=FALSE, verbose=FALSE, silent=FALSE,
useCluster=FALSE, nbrNodes=2, initC=TRUE,
clusterString=rep("localhost", nbrNodes), tt=NULL,
parallelTesting=FALSE, clusterIter=!x$maxlike,
clusterType=c("PSOCK", "FORK"), ...)
A control object, of class sienaAlgorithm
Desired interface: FALSE gives a gui (graphical user interface implemented as a tcl/tk screen), FALSE gives a small amount of printout to the console.
Produces various output to the console if TRUE.
Produces no output to the console if TRUE, even if batch mode.
Boolean: whether to use a cluster of processes (useful if multiple processors are available).
Number of processes to use if useCluster is TRUE.
Boolean: set to TRUE if the simulation will use C routines (currently always needed). Only for use if using multiple processors, to ensure all copies are initialised correctly. Ignored otherwise, so is set to TRUE by default.
Definitions of clusters. Default set up to use the local machine only.
A tcltk
toplevel window. Used if called from the
model options screen.
Boolean. If TRUE, sets up random numbers to parallel those in Siena 3.
Boolean. If TRUE, multiple processes execute complete iterations at each call. If FALSE, multiple processes execute a single wave at each call.
Either "PSOCK" or "FORK". On Windows, must be "PSOCK". On a single non-Windows machine may be "FORK", and subprocesses will be formed by forking. If "PSOCK", subprocesses are formed using R scripts.
Arguments for the simulation function, see
simstats0c
:
usually, data
and effects
; possibly also
prevAns
if a previous reasonable provisional estimate was
obtained for a similar model; possibly also returnDeps
if
the simulated dependent variables (networks, behaviour) should
be returned.
Returns an object of class sienaFit
, some parts of which are:
Boolean indicating successful termination
Character string, values: "OK", "Error", or "UserInterrupt". "UserInterrupt" indicates that the user asked for early termination before phase 3.
Various characteristics of the data and model definition.
Fitted value of theta.
Estimated covariance matrix of theta; this is not available if the sienaAlgorithm object x was produced with simOnly=TRUE.
Matrix of estimated derivatives.
Matrix of deviations from target in phase 3.
Array of statistics from simulations in phase 3.
Observed statistics.
Observed statistics by wave, starting with the second wave .
Score function contributions for each wave for each simulation in phase 3. Zero if finite difference method is used
If returnDeps
is TRUE
:
list of simulated dependent variables (networks, behaviour).
Networks are given as a list of edgelists, one for each period.
Number of iterations actually performed in phase 3.
Runs a Robbins-Monro algorithm for parameter estimation using the three-phase
implementation in Snijders (2001) and
Snijders, Steglich and Schweinberger (2007),
with (if findiff=TRUE
in the sienaAlgorithm
object)
derivative estimation as in Schweinberger and Snijders (2007).
Phase 1 does a few iterations to
estimate the derivative matrix of the targets with respect to the
parameter vector. Phase 2 does the estimation. Phase 3 runs a
simulation to estimate standard errors and check convergence of the model. The
simulation function is called once for each iteration in these phases
and also once to initialise the model fitting and once to complete it.
Unless in batch mode, displays a tcl/tk screen to allow interruption
and to show progress.
Schweinberger, Michael, and Snijders, Tom A.B. (2007). Markov models for digraph panel data: Monte Carlo-based derivative estimation. Computational Statistics and Data Analysis 51, 4465-4483.
Snijders, Tom A.B. (2001). The statistical evaluation of social network dynamics. Sociological Methodology, 31, 361-395.
Snijders, Tom A.B., Steglich, Christian E.G., and Schweinberger, Michael (2007). Modeling the co-evolution of networks and behavior. Pp. 41-71 in Longitudinal models in the behavioral and related sciences, edited by Kees van Montfort, Han Oud and Albert Satorra; Lawrence Erlbaum.
Steglich, Christian E. G., Snijders, Tom A. B., and Pearson, Michael A. (2010). Dynamic networks and behavior: Separating selection from influence. Sociological Methodology, 40, 329-393.
Further see http://www.stats.ox.ac.uk/~snijders/siena/ .
There are print, summary and xtable
methods for sienaFit
objects: xtable
, print.sienaFit
# NOT RUN {
myalgorithm <- sienaAlgorithmCreate(nsub=2, n3=100)
# nsub=2 and n3=100 is used here for having a brief computation, not for practice.
mynet1 <- sienaDependent(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- sienaDataCreate(mynet1)
myeff <- getEffects(mydata)
ans <- siena07(myalgorithm, data=mydata, effects=myeff, batch=TRUE)
# or for conditional estimation
# }
# NOT RUN {
myalgorithm$condname <- 'mynet1'
myalgorithm$cconditional <- TRUE
ans <- siena07(myalgorithm, data=mydata, effects=myeff, batch=TRUE)
# }
# NOT RUN {
# or if a previous 'on track' result ans was obtained
# }
# NOT RUN {
ans1 <- siena07(myalgorithm, data=mydata, effects=myeff, prevAns=ans)
# }
Run the code above in your browser using DataLab