gof_test {multigraphr}R Documentation

Goodness of fit tests for random multigraph models

Description

Goodness of fit tests between an observed edge multiplicity sequence and an expected edge multiplicity sequence according to specified RSM or IEA hypotheses using Pearson (S) and information divergence (A) tests statistics.

Usage

gof_test(adj, type, hyp, deg.hyp, dof)

Arguments

adj

matrix of integer representing graph adjacency matrix.

type

equals 'graph' if adjacency matrix is for graphs (default), equals 'multigraph' if it is the equivalence of the adjacency matrix for multigraphs (with matrix diagonal representing loops double counted).

hyp

character string representing the null model, either 'IEAS' or 'ISA'.

deg.hyp

vector of integers with the sum equal to to 2m representing the degree sequence of the multigraph under the null model:
- if hyp = 'IEAS', then simple IEAS hypothesis with fully specified degree sequence deg.hyp
- if hyp = 'ISA', then simple ISA hypothesis with with fully specified stub assignment probabilities deg.hyp/2m
- if hyp = 'IEAS' and deg.hyp = 0, then composite IEAS hypothesis with edge multiplicity sequence estimated from data
- if hyp = 'ISA' and deg.hyp = 0, then composite ISA hypothesis with edge multiplicity sequence estimated from data

dof

integer giving degrees of freedom of test, r-1 for simple hypotheses and r-n for composite hypotheses where r = n(n+1)/2

Details

This function can be used to test whether there is a significant difference between observed multigraph and the expected multiplicity sequence according to a simple or composite IEA hypothesis.

Test statistics of Pearson (S) and of information divergence (A) type are used and test summary based on these two statistics are given as output.

p-values indicate whether we have sufficient evidence to reject the null that there is no significant difference between the observed and expected edge multiplicity sequence.

Value

summary

Data frame including observed values of test statistics S and A, degrees of freedom for the asymptotic chi^2-distributions of tests statistics, and p-values for the tests performed.

Author(s)

Termeh Shafie

References

Shafie, T. (2015). A Multigraph Approach to Social Network Analysis. Journal of Social Structure, 16.

Shafie, T. (2016). Analyzing Local and Global Properties of Multigraphs. The Journal of Mathematical Sociology, 40(4), 239-264.

#' Shafie, T., Schoch, D. (2021). Multiplexity analysis of networks using multigraph representations. Statistical Methods & Applications 30, 1425–1444.

See Also

get_degree_seq,get_edge_assignment_probs, gof_sim to check the reliability of your test

Examples

# Adjacency matrix of observed network (multigraph), n = 4 nodes , m = 15 edges
A <- t(matrix(c( 0, 1, 0, 3,
                   0, 0, 1, 7,
                   0, 1, 0, 3,
                   3, 6, 3, 2), nrow= 4, ncol=4))
deg <- get_degree_seq(adj = A, type = 'multigraph')

# Testing a simple IEAS hypothesis with above degree sequence
gof_test(adj = A, type = 'multigraph', hyp = 'IEAS', deg.hyp = deg, dof = 9)

# Testing a composite IEAS hypothesis
gof_test(adj = A, type  = 'multigraph', hyp = 'IEAS', deg.hyp = 0, dof = 6)

[Package multigraphr version 0.2.0 Index]