simstats0c | R Documentation |
The functions to be called as "FRAN" by siena07
.
They call compiled C++. Not for general users' use.
simstats0c(z, x, data=NULL, effects=NULL, fromFiniteDiff=FALSE,
returnDeps=FALSE, returnChains=FALSE, byWave=FALSE,
returnDataFrame=FALSE, returnLoglik=FALSE)
maxlikec(z, x, data=NULL, effects=NULL,
returnChains=FALSE, byGroup = FALSE, byWave=FALSE,
returnDataFrame=FALSE, returnLoglik=FALSE,
onlyLoglik=FALSE)
initializeFRAN(z, x, data, effects, prevAns = NULL, initC,
profileData = FALSE, returnDeps = FALSE, returnChains =
FALSE, byGroup = FALSE, returnDataFrame = FALSE,
byWave = FALSE, returnLoglik = FALSE, onlyLoglik = FALSE)
terminateFRAN(z, x)
z |
Control object, passed in automatically in |
x |
A sienaAlgorithm object, passed in automatically in |
data |
A sienaData object as returned by |
effects |
A sienaEffects object as
returned by |
fromFiniteDiff |
Boolean used during calculation of derivatives by finite differences. Not for user use. |
returnDeps |
Boolean. Whether to return the simulated networks in Phase 3. |
returnChains |
Boolean. Whether to return the chains. |
byWave |
Boolean. Whether to return the finite difference or
maximum likelihood
derivatives by wave (uses a great deal of memory). Only necessary
for |
byGroup |
Boolean. For internal use: allows different thetas for each
group to be used in |
returnDataFrame |
Boolean. Whether to return the chains as lists or data frames. |
returnLoglik |
Boolean. Whether to return the log likelihood of the simulated chain. |
onlyLoglik |
Boolean: whether to return just the likelihood for the simulated chain, plus details of steps accepted and rejected. |
prevAns |
An object of class "sienaFit" as returned by
|
initC |
If TRUE, call is to setup the data and model in C++. For use with multiple processes only. |
profileData |
Boolean to force dumping of the data for profiling
with |
Not for general users' use.
The name of simstats0c
or maxlikec
should be used for the element FRAN of the model object, the former when using
estimation by forward simulation, the latter for maximum likelihood estimation.
The arguments with no defaults must be passed in on the call to
siena07
.
initializeFRAN
and terminateFRAN
are called in both cases.
simstats0c
returns a list containing:
fra |
Simulated statistics. |
sc |
Scores with which to calculate the derivative (not phase 2 or if using finite differences or maximum likelihood). |
dff |
Contributions to the derivative if finite differences |
ntim |
For conditional processing, time taken. |
feasible |
Currently set to TRUE. |
OK |
Could be set to FALSE if serious error has occurred. |
sims |
A list of simulation results, one for each period. Each
list consists of a list for each data object, each of which consists of
a list for each network, each of which consists of a list for each period,
each component of which is an edgelist in matrix form (the columns
are from, to, value) (or vector for behavior variables).
Only if |
maxlikec
returns a list containing:
fra |
Simulated scores. |
dff |
Simulated Hessians: stored as lower triangular matrices |
ntim |
NULL, compatibility only |
feasible |
Currently set to TRUE. |
OK |
Could be set to FALSE if serious error has occurred. |
dff |
Simulated Hessian |
sims |
NULL, for compatibility only |
chain |
A list of sampled chains, one for each period. Each
list consists of a list for each data object, each of which consists of
a list for each network, each of which consists of a list for each period,
each component of which is a list or a data frame depending on the
value of |
accepts |
Number of accepted MH steps by dependent variable (permute steps are counted under first dependent variable) |
rejects |
Number of rejected MH steps by dependent variable (permute steps are counted under first dependent variable) |
aborts |
Number of aborted MH steps counted under first dependent variable. |
loglik |
Loglikelihood of the simulations. Only if
|
initializeFRAN
and terminateFRAN
return the control
object z
.
Ruth Ripley
See https://www.stats.ox.ac.uk/~snijders/siena/
siena07
mynet1 <- sienaNet(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- sienaDataCreate(mynet1)
myeff <- getEffects(mydata)
myeff <- includeEffects(myeff, transTrip)
myalgorithm <- sienaAlgorithmCreate(fn=simstats0c, nsub=2, n3=100, projname=NULL)
ans <- siena07(myalgorithm, data=mydata, effects=myeff, batch=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.