我有一个很大的网络,当我运行 ergm 模型时,R 总是会崩溃。 (同时它显示内存使用率很高)。
有人知道我能做什么吗?
library(network)
library(ergm)
gc()
model.1a <- ergm(net[[1]] ~ edges() +
nodecov("dist2coast") + nodecov("dist2rail60") +
nodecov("dist2paved") + edgecov(dist_matrix),
control = control.ergm(
seed = 1,
MCMLE.maxit = 10,
parallel = 4,
CD.maxit = 10
)
)
net[[1]]
Network attributes:
vertices = 7819
directed = FALSE
hyper = FALSE
loops = FALSE
multiple = FALSE
bipartite = FALSE
total edges= 273
missing edges= 0
non-missing edges= 273
Vertex attribute names:
agglosID agglosName builtUp capital class1 class2 class3 dist2capital dist2coast dist2emst dist2first dist2impr dist2paved dist2placebo16 dist2placebo22 dist2rail60 dist2rail60mil dist2rail60min dist2river dist2second first geometry ISO3 L1 Latitude Longitude mean2010 Metropole nodeID.1 notown Pop1950 Pop1960 Pop1970 Pop1980 Pop1990 Pop2000 Pop2010 Pop2015 prec_mean second sparseveg undetermined vertex.names Voronoi water
No edge attributes
这里有几个问题:
edges
,不带括号。edgecov
项,其矩阵为 7819 x 7819。不过,MCMC 并未使用,因此 (1) 您不需要 MCMC 和CD 控制参数和 (2) 您所经历的“R 的破坏”并不是由于马尔可夫链误入歧途。verbose=TRUE
到 ergm()
重新运行估计,并使用它生成的消息更新您的问题。否则很难推断出估计发生了什么。