compare_predictions: Compare predictions of ERGM to FERGM.

Description Usage Arguments Value References Examples

View source: R/compare_predictions.R

Description

This function allows you to assess the importance of the frailty term in prediction by comparing the predictive accuracy of an ERGM to an FERGM.

Usage

1
2

Arguments

ergm.fit

A model object returned by the ergm function. Must be specified.

fergm.fit

A model object returned by the fergm function. Must be specified.

seed

An integer that sets the seed for the random number generator to assist in replication. Defaults to a null value for no seed setting.

replications

The number of networks to be simulated to assess predictions. Defaults to 500.

Value

The compare_predictions function returns a matrix reflecting the number of correctly predicted ties for the ERGM and FERGM for each network simulated.

References

Box-Steffensmeier, Janet M., Dino P. Christenson, and Jason W. Morgan. 2018. “Modeling Unobserved Heterogeneity in Social Networks with the Frailty Exponential Random Graph Model." Political Analysis. (26)1:3-19.

Stan Development Team (2016). RStan: the R interface to Stan. R package version 2.14.1. http://mc-stan.org/.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# load example data
data("ergm.fit")
data("fergm.fit")
data("mesa")

# Use built in compare_predictions function to compare predictions of ERGM and FERGM,
# few replications due to example
predict_out <- compare_predictions(ergm.fit = ergm.fit, fergm.fit = fergm.fit,
                                   replications = 10)

# Use the built in compare_predictions_plot function to examine the densities of
#  correctly predicted ties from the compare_predictions simulations
compare_predictions_plot(predict_out)

# We can also conduct a KS test to determine if the FERGM fit
     # it statistically disginguishable from the ERGM fit
compare_predictions_test(predict_out)

## End(Not run)

benjamin-w-campbell/fergm documentation built on Aug. 24, 2018, 9:38 p.m.