siena07 {RSiena}R Documentation

Function to fit a model

Description

Fits a model using method of moments, based on straightforward simulation, conditional or otherwise, or on an MCMC simulation. Estimation is done using Robbins-Monro algorithm. Note that the particular model to be used is passed in on the model object, and data for the model must be passed in using named arguments as the .... (See examples)

Usage

siena07(x, batch=FALSE, verbose=FALSE, useCluster=FALSE,
nbrNodes=2, initC=FALSE, clusterString=rep("localhost", nbrNodes),
tt=NULL, parallelTesting=FALSE, ...)

Arguments

x A model object
batch Desired interface: 'batch' is a small amount of printout to the console
verbose Produces various output to the console if TRUE
useCluster Boolean: whether to use a cluster of processes
nbrNodes Number of processes to use if useCluster is TRUE
initC 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.
clusterString Definitions of clusters. Default set up to use the localmachine only.
tt A tcltk toplevel window. Used if called from the model options screen.
parallelTesting Boolean. If TRUE, sets up random numbers to parallel those in Siena 3.
... Arguments for the simulation function

Details

Runs a three-phase model estimation. 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 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.

Value

Returns an object of class "sienaFit", some parts of which are:

theta Fitted value of theta
covtheta Estimated covariance matrix of theta
dfra Matrix of estimated derivatives
sf Matrix of deviations from target in phase 3
sf2 Array of statistics from simulations in phase 3
targets Observed statistics
targets2 Observed statistics for each wave
ssc Score function contributions for each wave for each simulation in phase 3
sims List of simulated networks, currently just one entry for the first network. Each a list of edgelists, one for each period.

Author(s)

Ruth Ripley

References

See http://www.stats.ox.ac.uk/~snijders/siena/

See Also

There are print, summary and xtable methods for sienaFit objects sienaModelCreate, print.sienaFit

Examples

mymodel <- sienaModelCreate(fn=simstats0c, nsub=2, n3=100)
mynet1 <- sienaNet(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- sienaDataCreate(mynet1)
myeff <- getEffects(mydata)
ans <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)

#or for conditional estimation
## Not run: 
mymodel$condname <- 'mynet1'
mymodel$cconditional <- TRUE
ans <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)
## End(Not run)

[Package RSiena version 1.0.8 Index]