Learn R Programming

snowboot (version 0.5.1)

cross_validation: A function that uses cross-validation to select seed-wave combination for estimation of a degree's frequency.

Description

The function's inputs are a network, a vector of possible seed sample-sizes, a vector of possible waves, and a few tuning parameters. The output will contain the best seed-wave combination for each degree and the width of the 95 percent bootstrap confidence intervals at each degree for the best seed-wave combination.

Usage

cross_validation(network, n.seeds, n.neigh, n.boot, kmax, proxyRep = 19, proxyOrder = 30)

Arguments

network
A network object that is list containing:
edges
The edgelist of the network. A two column matrix where each row is an edge.

degree
The degree sequence of the network, which is an integer vector of length n.

n
The network order.

The object can be created by local.network.MR.new5 or it can be imported.

n.seeds
A numeric vector for the different sample sizes of seed to use in cross-validation.
n.neigh
A numeric vector for the different waves to use in cross-validation.
n.boot
The number of bootstrap sample.
kmax
The largest degree to preform cross-validation on.
proxyRep
The number of time to sample a proxy. Default is 19.
proxyOrder
The size of the proxy sample. Default is 30.

Value

A list consisting of
selected_seed_wave
A list of 3 matrices (one per estimation method. See supporting documentation bootdeg). Each matrix provides the best seed-wave combinations (obtained via cross-validation) for the respective estimation method.
selected_seed_wave
A list of 3 matrices (one per estimation method. See supporting documentation bootdeg). Each matrix provides the 95 percent bootstrap confidence intervals for the estimated degree frequency using the best seed-wave combinations (see above).

References

Efron, B. (1979). Bootstrap methods: another look at the jackknife. The annals of Statistics, 1-26.

Thompson, M. E., Ramirez Ramirez, L. L., Lyubchich, V. and Gel, Y. R. (2015), Using the bootstrap for statistical inference on random graphs. Can J Statistics. doi: 10.1002/cjs.11271

Examples

Run this code
net <- artificial_networks[[1]]
a <- cross_validation(network = net, n.seeds = c(10, 20, 30), n.neigh = c(1, 2),
 n.boot = 200, kmax = 30)

Run the code above in your browser using DataLab