localboot {localboot} | R Documentation |
Local Bootstrap for Network Data
Description
This function applies a local bootstrap method to network data, represented by an adjacency matrix. It offers various methods and options for bootstrapping, including handling weighted networks and custom distance functions.
Usage
localboot(
A,
B,
quantile_n = 0,
returns = "boot",
method = "own",
dist_func = get_dist_default_eigen,
kowning_u = NULL,
induced_sampling = TRUE,
weighted = FALSE,
getT = NULL,
user_blist = NULL,
fast = NULL,
...
)
Arguments
A |
A square adjacency matrix of the network. |
B |
The number of bootstrap samples to generate. |
quantile_n |
The quantile used for neighborhood selection in some methods. If set to 0 (default), it's calculated as (log(N) / N)^0.5. |
returns |
Specifies the type of output returned. Possible values are "boot" (default), "p_and_time", "p_and_boot", and "T". |
method |
The method used for bootstrapping. Options are "own" and "zhu". |
dist_func |
A function to compute the distance matrix. Default is 'get_dist_default_eigen'. |
kowning_u |
An optional known 'u' vector for distance calculation. |
induced_sampling |
A logical indicating whether to use induced sampling. Defaults to TRUE. |
weighted |
A logical indicating if the network is weighted. Defaults to FALSE. |
getT |
An optional function to apply to each bootstrapped sample. |
user_blist |
An optional user-provided bootstrap list. |
fast |
A logical indicating if a faster, approximate method should be used. Automatically set based on network size if NULL. |
... |
Additional arguments passed to other methods. |
Value
Depending on the 'returns' argument, this function can return various types of outputs including bootstrapped networks, estimated probabilities, computation times, and statistics from the 'getT' function.
Examples
# Example usage
P = generate_graphon(100, 1)
A = generate_network_P(P, replicate = 1, symmetric.out = TRUE)
result <- localboot(A = A, B = 100, returns = "boot")