Simulation Engine for dynamic Vertex case.
Simulation engine for dynamic networks with variable number of vertices. Implements exponential family based hierarchical model for vertices and the edges.
engineVertex( InputNetwork, numSim, maxLag, VertexStatsvec = rep(1, nvertexstats), VertexLag = rep(1, maxLag), VertexLagMatrix = matrix(1, maxLag, length(VertexStatsvec)), VertexModelGroup = NA, VertexAttLag = rep(1, maxLag), dayClassObserved = NA, dayClassFuture = NA, EdgeModelTerms, EdgeModelFormula, EdgeGroup = NA, EdgeIntercept = c("edges"), EdgeNetparam = NA, EdgeExvar = NA, EdgeLag = rep(1, maxLag), EdgeLagMatrix = matrix(1, maxLag, length(EdgeModelTerms)), regMethod = "bayesglm", paramout = TRUE )
InputNetwork
: List of input networksnumSim
: number of time points to simulatemaxLag
: maximum LagVertexStatsvec
: Binary vector for vertex model.VertexLag
: vector of lag for vertexVertexLagMatrix
: matrix of lags for vertex stats.VertexModelGroup
: Group term for vertex model.VertexAttLag
: Lag vector for group term for vertex.dayClassObserved
: Observed day class.dayClassFuture
: Dayclass vector for future, must be of size numsim.EdgeModelTerms
: Edge Model termsEdgeModelFormula
: Edge model formulaEdgeGroup
: edge group termEdgeIntercept
: edge interceptEdgeNetparam
: edge network parameter nameEdgeExvar
: edge extraneous variableEdgeLag
: edge Lag vectorEdgeLagMatrix
: edge lag matrixregMethod
: regression method. "bayesglm" by defaultparamout
: T/F on if regression needs to run.List with following elements: SimNetwork: Output Networks EdgeParameterMat: Matrix of edge parameter VertexParameterMat: Matrix of Vertex parameters.
## Not run: nvertexstats <- 9 maxLag = 3 VertexLag = rep(1, maxLag) VertexLagMatrix <- matrix(0, maxLag, nvertexstats) VertexLagMatrix[, c(4, 7)] <- 1 VertexLagMatrix[c(2,3),7] <- 0 getWeekend <- function(z){ weekends <- c("Saturday", "Sunday") if(!network::is.network(z)){ if(is.na(z)) return(NA) } else { zDay <- get.network.attribute(z, attrname = "day") out <- ifelse(zDay %in% weekends, 1, 0) return(out) } } dayClass <- numeric(length(beach)) for(i in seq_along(dayClass)) { dayClass[i] <- getWeekend(beach[[i]]) } dayClass <- na.omit(dayClass) simResult <- suppressWarnings(engineVertex(InputNetwork = beach, numSim = 5, maxLag = 3, VertexStatsvec = rep(1, nvertexstats), VertexModelGroup = "regular", VertexAttLag = rep(1, maxLag), VertexLag = rep(1, maxLag), VertexLagMatrix = VertexLagMatrix, dayClassObserved = dayClass, dayClassFuture = c(1, 0, 0, 0, 0), EdgeModelTerms = NA, EdgeModelFormula = NA, EdgeGroup = NA, EdgeIntercept = c("edges"), EdgeNetparam = c("logSize"), EdgeExvar = NA, EdgeLag = c(0, 1, 0), paramout = TRUE )) ## End(Not run)
Abhirup
Useful links