gofMobilityNetwork: gofMobilityNetwork

View source: R/4_auxiliaryFunctions.R

gofMobilityNetworkR Documentation

gofMobilityNetwork

Description

Akin to ERGMs, goodness of fit testing is available to see whether auxiliary statistics are well captured by the model. The logic behind gof testing for network models is outlined in Hunter et al. (2008) and Lospinoso and Snijders (2019).

Usage

gofMobilityNetwork(ans, gofFunction, lvls = NULL, simulations = NULL)

gofDistributionNetwork(ans, gofFunction, lvls = NULL, simulations = NULL)

monanGOF(ans, gofFunction, lvls = NULL, simulations = NULL)

## S3 method for class 'gof.stats.monan'
plot(x, lvls = NULL, xlab = NULL, ...)

Arguments

ans

An object of class "result.monan" resulting from an estimation with the function estimateMobilityNetwork() using the option deps = TRUE.

gofFunction

A gof function that specifies which auxiliary outcome should be used, e.g., "getIndegree" or "getTieWeights".

lvls

The levels for which the gofFunction should be calculated. For getIndegree() and getTieWeights(), level k refers to the value k - 1 (e.g., level 1 counts the locations with indegree 0 or the empty dyads). If NULL, all levels up to the largest value in the observed or simulated networks are used. In plot, the levels to plot, as positions in the vector of values returned by gofMobilityNetwork; if NULL, all are plotted.

simulations

outdated parameter, no need to specify

x

An object of class "gof.stats.monan".

xlab

Label of the x-axis. By default "value" if the statistics are named by the values they refer to (as for getIndegree() and getTieWeights()), otherwise none.

...

Additional plotting parameters passed to graphics::boxplot().

Value

The function gofMobilityNetwork returns a list containing (1) the observed values of the auxiliary statistics and (2) a list of the simulated values of the auxiliary statistics.

The function plot.gof.stats.monan draws box plots of the gof tests with observed values superimposed in red, and invisibly returns the result of graphics::boxplot(). The x-axis shows the values the statistics refer to (e.g., the indegree), if the gof function names its results.

References

Hunter, D. R., Goodreau, S. M., & Handcock, M. S. (2008). Goodness of fit of social network models. Journal of the American Statistical Association, 103(481), 248-258.

Lospinoso, J., & Snijders, T. A. (2019). Goodness of fit for stochastic actor-oriented models. Methodological Innovations, 12(3).

See Also

getIndegree(), getTieWeights()

Examples


# goodness of fit
myGofIndegree <- gofMobilityNetwork(ans = myResDN, 
                                    gofFunction = getIndegree, 
                                    lvls = 1:100)

myGofTieWeight <- gofMobilityNetwork(ans = myResDN, 
                                     gofFunction = getTieWeights, 
                                     lvls = 1:30)


plot(myGofIndegree,  lvls = 20:70)
plot(myGofTieWeight, lvls = 1:15)


MoNAn documentation built on Oct. 12, 2026, 5:07 p.m.