robustness: run robustness analysis for a source estimate by subsampling...

Description Usage Arguments Details Value See Also Examples

View source: R/robustness.r View source: R/robustness.r

Description

run robustness analysis for a source estimate by subsampling individual events.

Usage

1
2
3
4
5
6
7
robustness(
  x,
  type = c("edm", "backtracking", "centrality"),
  prop,
  n = 100,
  ...
)

Arguments

x

data.frame, dataset with individual events and their magnitude, to be passed to aggr_data

type

character, specifying the method, 'edm', 'backtracking' and 'centrality' are available.

prop

numeric, value between zero and one, proportion of events to be sampled

n

numeric, number of resamplings

...

parameters to be passed to origin methods origin_edm, origin_backtracking or origin_centrality

Details

We create subsamples of individual events and their magnitude using a sampling proportion p in [0, 1]. After aggregating the data, we apply the source estimation approach. Using this result, we deduce the relative frequency of how often the source estimate obtained with the complete data set can be recovered by source estimation based on the subsample. Thus, the estimate robustness is assessed by the proportion of estimate recovery.

Value

data.frame with columns

See Also

robustness-methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# generate random delay data
data(ptnAth)
require(igraph)
dat <- data.frame(node  = sample(size = 500, make.names(V(ptnAth)$name), replace = TRUE),
                  time  = sample(size = 500, 1:10, replace = TRUE),
                  delay = rexp(500, rate=10))
# compute effective distance
net <- igraph::as_adjacency_matrix(ptnAth, sparse=FALSE)
p <- net/rowSums(net)
eff <- eff_dist(p)
colnames(eff) <- paste('x.',colnames(eff),sep='')

# run robustness analysis
r5 <- robustness(x=dat, type='edm', prop=0.5, n=10, distance=eff)
summary(r5)
plot(r5)

# compare results
r9 <- robustness(x=dat, type='edm', prop=0.9, n=10, distance=eff)
plot(r9, add=TRUE, col='gray')

NetOrigin documentation built on April 1, 2021, 5:07 p.m.