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)
simstats0c
returns a list containing:
Simulated statistics.
Scores with which to calculate the derivative (not phase 2 or if using finite differences or maximum likelihood).
Contributions to the derivative if finite differences
For conditional processing, time taken.
Currently set to TRUE.
Could be set to FALSE if serious error has occurred.
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 returnDeps
is TRUE.
maxlikec
returns a list containing:
Simulated scores.
Simulated Hessians: stored as lower triangular matrices
NULL, compatibility only
Currently set to TRUE.
Could be set to FALSE if serious error has occurred.
Simulated Hessian
NULL, for compatibility only
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 returnDataFrame
.
Only if returnChainss
is TRUE.
Number of accepted MH steps by dependent variable (permute steps are counted under first dependent variable)
Number of rejected MH steps by dependent variable (permute steps are counted under first dependent variable)
Number of aborted MH steps counted under first dependent variable.
Loglikelihood of the simulations. Only if
returnLoglik
is TRUE. If onlyLoglik
is TRUE, only
loglik
, accepts
,rejects
and aborts
are
returned.
initializeFRAN
and terminateFRAN
return the control
object z
.
Control object, passed in automatically in siena07
.
A sienaAlgorithm object, passed in automatically in siena07
.
A sienaData object as returned by sienaDataCreate
.
A sienaEffects object as
returned by getEffects
.
Boolean used during calculation of derivatives by finite differences. Not for user use.
Boolean. Whether to return the simulated networks in Phase 3.
Boolean. Whether to return the chains.
Boolean. Whether to return the finite difference or
maximum likelihood
derivatives by wave (uses a great deal of memory). Only necessary
for sienaTimeTest
Boolean. For internal use: allows different thetas for each
group to be used in sienaBayes
.
Boolean. Whether to return the chains as lists or data frames.
Boolean. Whether to return the log likelihood of the simulated chain.
Boolean: whether to return just the likelihood for the simulated chain, plus details of steps accepted and rejected.
An object of class "sienaFit" as returned by
siena07
, from which scaling
information (derivative matrix and standard deviation of the
deviations) will be extracted along with the latest version of the
parameters which will be used as the initial values, unless the
model requests the use of standard initial values. If the previous
model is exactly the same as the current one, Phase 1 will be omitted. If
not, any parameter estimates for effects which are included in
the new model will be used as initial
values, but phase 1 will still be carried out.
If the results used as prevAns
are a reasonable starting point,
this will increase the efficiency of the algorithm.
If TRUE, call is to setup the data and model in C++. For use with multiple processes only.
Boolean to force dumping of the data for profiling
with sienaProfile.exe
.
Ruth Ripley
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.
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)
Run the code above in your browser using DataLab