struct_test computes the test by generating the null distribution using
Monte Carlo simulations (rewiring). struct_test_asymp computes the
test using an asymptotic approximation. While available, we do not recommend
using the asymptotic approximation since it has not shown good results when
compared to the MC approximation. Furthermore, the asymptotic version has only
been implemented for graph as static graph.
The output from the hist method is the same as hist.default.
struct_test is a wrapper for the function boot from the
boot package. Instead of resampling data--vertices or edges--in each iteration the function
rewires the original graph using rewire_graph and applies
the function defined by the user in statistic.
The default values to rewire_graph via rewire.args are:
p |
Number or Integer with default n_rewires(graph). |
undirected |
Logical scalar with default getOption("diffnet.undirected", FALSE). |
copy.first |
Logical scalar with TRUE. |
In struct_test … are passed to boot, otherwise are passed
to the corresponding method (hist for instance).
From the print method, p-value for the null of the statistic been
equal between graph and its rewired versions is computed as follows
$$%
p(\tau)=2\times\min\left(\mbox{Pr}(t\leq\tau), \mbox{Pr}(t\geq\tau)\right) %
$$
Where \(\mbox{Pr}\{\cdot\}\) is approximated using the
Empirical Distribution Function retrieved from the simulations.
For the case of the asymptotic approximation, under the null we have
$$%
\sqrt{n}\left(\hat\beta(Y,G)-\mu_\beta\right)\sim^d\mbox{N}\left(0,\sigma_\beta^2\right)
$$
The test is actually on development by Vega Yon and Valente. A copy of the
working paper can be distributed upon request to g.vegayon@gmail.com.
The function n_rewires proposes a vector of number of rewirings that
are performed in each iteration.