Learn R Programming

RSiena (version 1.0.9)

siena07: 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, silent=FALSE, useCluster=FALSE,
nbrNodes=2, initC=FALSE, clusterString=rep("localhost", nbrNodes),
tt=NULL, parallelTesting=FALSE, ...)

Arguments

Value

Returns an object of class "sienaFit", some parts of which are:thetaFitted value of thetacovthetaEstimated covariance matrix of thetadfraMatrix of estimated derivativessfMatrix of deviations from target in phase 3sf2Array of statistics from simulations in phase 3targetsObserved statisticstargets2Observed statistics for each wavesscScore function contributions for each wave for each simulation in phase 3simsList of simulated networks, currently just one entry for the first network. Each a list of edgelists, one for each period.

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.

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

Run this code
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
mymodel$condname <- 'mynet1'
mymodel$cconditional <- TRUE
ans <- siena07(mymodel, data=mydata, effects=myeff, batch=TRUE)

Run the code above in your browser using DataLab