This function computes the sample Fréchet mean from an observed sample of network-valued random variables according to a specified matrix representation. It currently only supports the Euclidean geometry i.e. the sample Fréchet mean is obtained as the argmin of the sum of squared Frobenius distances.
Arguments
- x
An
nvd
object.- weights
A numeric vector specifying weights for each observation (default: equally weighted).
- representation
A string specifying the graph representation to be used. Choices are adjacency, laplacian, modularity, graphon. Default is adjacency.
- ...
Other argument to be parsed to the
mean
function.
Examples
params <- list(n = 24L, p = 1/3)
x <- nvd(sample_size = 1L, model = "gnp", !!!params)
#> ℹ Calling the `tidygraph::play_gnp()` function with the following arguments:
#> • n: 24
#> • p: 0.333333333333333
#> • directed: TRUE
#> • loops: FALSE
mean(x)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
#> [1,] 0 0 0 0 0 1 0 0 0 1 0 0 1
#> [2,] 1 0 0 1 1 0 1 1 0 0 1 0 1
#> [3,] 1 0 0 1 0 1 0 0 1 0 1 0 0
#> [4,] 0 1 0 0 0 0 1 0 1 1 0 1 0
#> [5,] 0 0 0 0 0 1 0 1 0 0 0 1 1
#> [6,] 0 0 0 0 1 0 1 0 1 0 0 0 0
#> [7,] 0 0 0 1 1 1 0 1 0 0 0 0 0
#> [8,] 1 0 1 0 0 0 1 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 1 1 0 0 0 0 1
#> [10,] 1 0 0 0 0 1 1 1 0 0 0 1 0
#> [11,] 0 1 0 1 0 1 0 1 1 1 0 0 0
#> [12,] 0 0 1 1 0 1 1 1 0 0 1 0 1
#> [13,] 0 0 1 0 0 0 0 1 1 1 1 1 0
#> [14,] 1 0 0 0 1 0 0 0 1 1 1 0 1
#> [15,] 0 0 0 0 0 1 1 0 1 0 0 0 0
#> [16,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [17,] 0 1 0 0 0 0 0 0 0 0 1 0 0
#> [18,] 0 0 0 1 0 1 1 1 1 1 0 1 0
#> [19,] 1 0 0 1 0 0 1 1 1 0 1 0 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