engineEdgeBayes {dnr} | R Documentation |
Implementation of simulation engine for dynamic networks using smoothing estimates of change statistics.
Description
Implementation of simulation engine for dynamic networks using smoothing estimates of change statistics.
Usage
engineEdgeBayes(
start_network,
inputcoeff,
ns,
model.terms,
model.formula,
graph_mode,
group,
intercept,
exvar,
maxlag,
lagmat,
ylag,
lambda = NA,
method = "bayesglm",
alpha.glmnet,
paramout = TRUE,
Theta = NA
)
Arguments
start_network |
Initial list of networks |
inputcoeff |
coefficient vector |
ns |
number of time points for simulation |
model.terms |
model terms in formula |
model.formula |
model formula (ergm) |
graph_mode |
'digraph' by default |
group |
group terms |
intercept |
intercept terms |
exvar |
extraneous covariates |
maxlag |
maximum lag |
lagmat |
lag matrix |
ylag |
lag vector for network lag terms |
lambda |
NA |
method |
'bayesglm' by default |
alpha.glmnet |
NA |
paramout |
T/F parameter estimation is returned. |
Theta |
= prior probability matrix. |
Examples
## Not run:
startNet <- rdNets[1:50]
model.terms=c("triadcensus.003", "triadcensus.012", "triadcensus.102", "triadcensus.021D", "gwesp")
model.formula = net~triadcensus(0:3)+gwesp(alpha=0, fixed=FALSE, cutoff=30)-1
graph_mode <- 'digraph'
group <- 'dnc'
alpha.glmnet <- 1
method <- 'bayesglm'
maxlag <- 3
lambda <- NA
intercept <- "edges"
cdim <- length(model.terms)
lagmat <- matrix(sample(c(0,1),(maxlag+1)*cdim,replace = TRUE),ncol = cdim)
ylag <- rep(1,maxlag)
lagmat[1,] <- rep(0,ncol(lagmat))
out.coef <- paramEdge(input_network = startNet,
model.terms = model.terms,
model.formula = model.formula,
graph_mode='digraph',
group=group,intercept = intercept,
exvar=NA,
maxlag = maxlag,
lagmat = lagmat,
ylag = ylag,
lambda = NA, method='bayesglm',
alpha.glmnet=1)
inputcoeff <- out.coef$coef$coef.edge
nvertex <- 47 ##find vertex here
ns <- 1
exvar <- NA
for(i in seq_along(startNet)) Theta <- Theta + startNet[[i]][,]
Theta <- Theta/length(startNet)
Theta <- thresh(Theta)
out.bayes <- engineEdgeBayes(start_network=startNet,
inputcoeff=inputcoeff,
ns=ns,
model.terms=model.terms,
model.formula=model.formula,
graph_mode=graph_mode,
group=group,intercept=intercept,
exvar=exvar,
maxlag=maxlag,
lagmat=lagmat,
ylag=ylag,
lambda = NA, method='bayesglm',
alpha.glmnet=alpha.glmnet,
Theta = Theta)
## End(Not run)
[Package dnr version 0.3.5 Index]