if (FALSE) {
### delays on Goettingen bus network
# compute effective distance
data(ptnGoe)
goenet <- igraph::as_adjacency_matrix(ptnGoe, sparse=FALSE)
p <- goenet/rowSums(goenet)
eff <- eff_dist(p)
# apply source estimation
data(delayGoe)
if (requireNamespace("aplyr", quietly = TRUE)) {
res <- alply(.data=delayGoe[11:20,-c(1:2)], .margins=1, .fun=origin_edm,
distance=eff, silent=TRUE, .progress='text')
perfGoe <- ldply(Map(performance, x = res, start = 2, list(graph = ptnGoe)))
# performance plots
plot_performance(perfGoe, var='rank', ylab='rank of correct detection', text.padding=0.5)
plot_performance(perfGoe, var='dist', ylab='distance to correct detection')
}
### delays on Athens metro network
# compute effective distance
data(ptnAth)
athnet <- igraph::as_adjacency_matrix(ptnAth, sparse=FALSE)
p <- athnet/rowSums(athnet)
eff <- eff_dist(p)
# apply source estimation
data(delayAth)
if (requireNamespace("aplyr", quietly = TRUE)) {
res <- alply(.data=delayAth[11:20,-c(1:2)], .margins=1, .fun=origin_edm,
distance=eff, silent=TRUE, .progress='text')
perfAth <- ldply(Map(performance, x = res, start = as.list(delayAth$k0),
list(graph = ptnAth)))
# performance plots
plot_performance(perfAth, var='rank', ylab='rank of correct detection',text.padding=0.5)
plot_performance(perfAth, var='dist', ylab='distance to correct detection')
}
}
Run the code above in your browser using DataLab