Understanding animal social structure: exponential random graph models in animal behaviour research

The social environment is a pervasive influence on the ecological and evolutionary dynamics of animal populations. Recently, social network analysis has provided an increasingly powerful and diverse toolset to enable animal behaviour researchers to quantify the social environment of animals and the impact that it has on ecological and evolutionary processes. However, there is considerable scope for improving these methods further. We outline an approach specifically designed to model the formation of network links, exponential random graph models (ERGMs), which have great potential for modelling animal social structure. ERGMs are generative models that treat network topology as a response variable. This makes them ideal for answering questions related directly to how and why social associations or interactions occur, from the modelling of population level transmission, through within-group behavioural dynamics to social evolutionary processes. We discuss how ERGMs have been used to study animal behaviour previously, and how recent developments in the ERGM framework can increase the scope of their use further. We also highlight the strengths and weaknesses of this approach relative to more conventional methods, and provide some guidance on the situations and research areas in which they can be used appropriately. ERGMs have the potential to be an important part of an animal behaviour researcher's toolkit and fully integrating them into the field should enhance our ability to understand what shapes animal social interactions, and identify the underlying processes that lead to the social structure of animal populations.

Quantifying a complex social environment can represent a challenge, but can be achieved through the suite of tools available in social network analysis. A network approach is useful as social relationships are an emergent property of the interactions of multiple individuals, and there is increasing evidence that indirect connections among individuals within animal populations are important (Brent, 2015). In the last decade social network analysis, originally developed in the social and physical sciences, has become a pervasive tool in the study of animal behaviour Pinter-Wollman et al., 2013). As well as directly modelling social relationships, it can be integral to understanding other behaviour in the context of its social environment. For instance, networks have been used in the study of the social and spatial components of dispersal behaviours (Blumstein, Wey, & Tang, 2009;Fletcher, Acevedo, Reichert, Pias, & Kitchens, 2011).
The statistical analysis of social networks is complicated by the nonindependence of individuals within a population that results from linking individuals together within a network (Croft, Madden, Franks, & James, 2011;Farine & Whitehead, 2015). This confounds the use of the conventional statistical approaches used in ecology such as the linear model and linear mixed model, as these methods assume independence of the residuals, which is an invalid assumption for individuals that are linked in a network. In light of this, numerous statistical methodologies have been developed to analyse social network structure. Typically, the analysis of animal social networks has revolved around randomization-based approaches to significance testing (Croft et al., 2011;Farine & Whitehead, 2015). The data used to construct networks are permuted to generate uncertainty around a null hypothesis, with permutations typically constrained to produce biologically plausible null models. For example, if researchers are studying how body size relates to social network connections in a population spread over several sites, they would randomize interactions with respect to body size, but constrain the randomized network connections according to the site use of that individual.
Randomization-based analyses have many strengths, especially in animal social network studies in which complex sampling issues often have to be controlled for (Farine & Whitehead, 2015;Farine, 2017). However, using this approach controls for, rather than models, the biological processes, such as site use, that generate network structure. Often these processes can be directly of interest, yet treating them as a nuisance factor prevents us from more fully understanding the role they play in shaping animal social systems. Furthermore, randomization-based approaches generate uncertainty around the null hypothesis, rather than the observations, yet it is the observations that truly are observed with error. Finally, null models are often user-defined and system-specific as the validity of the comparison is sensitive to the way in which null models are constructed. As a result, they may not always be the best option available.
There are also several statistical modelling frameworks for social networks developed within the social sciences, some of which are now increasingly being employed in studies of animal social networks. Many of these modelling frameworks are designed specifically to analyse network data. Further, some are generative models, with the underlying processes that govern interactions explicitly modelled, with the local network topology as a response variable (Cranmer, Leifeld, McClurg, & Rolfe, 2016;Silk, Croft, Delahay, Hodgson, Weber et al., 2017). This is extremely useful for researchers specifically aiming to explain the social interactions that occur among individuals, and the observed structure of the entire network, a very common topic of research in animal behaviour (e.g. Best, Dwyer, Seddon, & Goldizen, 2014;Carter, Brand, Carter, Shorrocks, & Goldizen, 2013;VanderWaal, Atwill, Isbell, & McCowan, 2014). However, the general applicability of these approaches to the study of animal social behaviour has not yet been discussed or assessed.
In this article, we review the use of one of the more highly developed and flexible of these statistical network approaches, exponential random graph models (ERGMs; Lusher et al., 2013;Robins, Pattison, Kalish, & Lusher, 2007). We start by providing a basic verbal description of the modelling approach, illustrating some of the key aspects of model fitting with a toy example. We then describe the previous uses of these models in the study of animal social behaviour, before going on to discuss their strengths and weaknesses as a method to model animal social networks and how these models can be extended to understand more complex network data sets that are increasingly used to study animal behaviour (temporally dynamic, bipartite and multilayer networks). Finally, we set an agenda for future research: highlighting the importance of simulation modelling studies to better understand when ERGMs may represent an appropriate tool, and determining research areas that this method is best suited to. Our aim is not to displace the use of randomization-based approaches, but to describe an alternative tool that can be applied in many situations. This will give animal behaviour researchers a wider array of options than are currently in use.

MODEL DESCRIPTION
ERGMs are models of network topology that enable hypotheses about the processes driving local network structure and edge formation to be tested (Lusher et al., 2013;Robins et al., 2007). They model potential edges between individuals as stochastic variables within an adjacency matrix. The response variable is the probability of matching the observed network, with the explanatory variables representing various possible structural features of the network. ERGMs fit broadly within the same exponential family of statistical models as conventional linear and generalized linear modelling approaches. A mathematical representation of the model is: where P(N) is the probability of a given network and each z is a different network statistic or property of the network. The effect of each z is weighted by a parameter (q) in a similar manner to a generalized linear model. In this equation c is a normalizing constant.
Note that this is for a single network; ERGMs were originally developed for the analysis of static networks, although recent developments have made the analysis of dynamic networks possible (see below). Initially, potential edges (regardless of whether they exist or not) could only be modelled as binary variables (present or absent); however, recent generalizations of the ERGM framework now enable models of weighted edges (Desmarais & Cranmer, 2012;Krivitsky, 2012;Wilson, Denny, Bhamidi, Cranmer, & Desmarais, 2017). These models for weighted edges are often likely to be preferred, as edge weights frequently carry most of the information on social structure in many animal networks, and filtering networks by threshold edge weights can affect statistical inference (Farine, 2014;Franks, Ruxton, & James, 2010). Alternatively, researchers can capture repeated interactions through temporal ERGMs, where the change in the network structure over time is considered. We discuss these two extensions (and others) of the basic ERGM below. Ultimately, the decision on whether to use binary or weighted, static or temporal networks will be question, and to some extent data, driven (Carter, Lee, & Marshall, 2015).
Network edges are modelled in response to attributes of the nodes that they connect, and the value of other edges within the network. The latter possibility means that the ERGM framework accounts for the fact that edge values can be dependent on the values of neighbouring edges or some other aspect of network topology, making the network structure locally emergent and therefore directly dealing with nonindependence related to this (Lusher et al., 2013). Crucially, unlike randomization-based methods, this approach directly models the behaviours that lead to social associations or interactions, and so models social network structure.
A guide to the types of term that can be included within ERGMs is provided in Fig. 1. From a practical perspective terms fit into three broad categories: (1) node-based covariates, (2) dyadic covariates and (3) structural covariates.
(1) Node-based covariates explain differences in edge values as outcomes of the attributes of the nodes themselves. Taking the case of sex-related differences, for example, node-based covariates could be used to model which sex formed more (or stronger) edges, and additionally whether intrasex edges were more likely than intersex ones (i.e. males tending to interact with other males, and females with females). Node-based covariates for continuous traits can also include a difference term; for example, are edges more likely when the attributes of two individuals are more similar? This might be expected in situations such as dominance hierarchies where interactions are more likely if two individuals are more closely matched (e.g. Dey & Quinn, 2014).
(2) Dyadic covariates model how other relationships among individuals in a network affect edge values. For example, with animal social networks, where space use is often an important component of social structure, a matrix of the distances between individual home ranges or refuges might be a valuable dyadic covariate. Another example might be genetic relatedness, if social relationships within a group are thought to be influenced by kinship (e.g. Carter et al., 2013;Godde, Côt e, & R eale, 2015;Wolf, Mawdsley, Trillmich, & James, 2007).
(3) Structural covariates are aspects of network topology that might be expected to affect edge formation, and can occur at several levels of complexity (Fig. 1). The most basic structural term would be a measure of edge density, somewhat equivalent to having an intercept within a generalized linear model. This models the general tendency for individuals to be connected to other individuals, and is typically negative in social networks as individuals tend not to be connected to all other individuals. Increasingly complex structural terms can be incorporated, and these define the dependency structure used within the model to understand how the presence/absence of edges influences the presence/absence of nearby edges. For example, this might include configurations of multiple edges from a node, or measures of transitivity. The former consists of 'k-star' terms which estimate the frequency of edge configurations from a node with k completed edges (e.g. 3-star measures the frequency of three completed edges connected to a node). Measures of transitivity model how the likelihood or value of an edge between i and j changes if both i and j are also already connected to k (a consideration of 'friends-of-friends' effects). For directed networks these dependencies can include directionality as well; for example, reciprocity might be hypothesized to be a strong underlying process driving network structure in some social systems. Similarly, edges completing triads can be either transitive (i / j, i / k and j / k) or cyclical (i / j, j / k and k / i), and these different properties might be integral to the structure of some networks, such as linear dominance hierarchies where cyclical triads would be expected to be much less common than otherwise expected (Shizuka & McDonald, 2012).
The distinction between node-based and dyadic covariates is somewhat artificial, and, in some cases, a variable could be intuitively considered as either. For example, if individuals more similar in size are expected to interact more, one could fit difference in size density() also fulfils a similar role

Transitiveties() Effect of transitivity in directed networks
Edges/kstar (1) Kstar (2) Nodefactor() Nodecov() as a node-based covariate or include it directly as a difference matrix. Our recommendation here is that dyadic covariates should be used when the variable only exists as a function of the two individuals (e.g. their genetic relatedness), while individual covariates should be used when the variable can be considered a trait of that individual alone (as for the example with size). Model fitting and selection differs somewhat from the fitting of generalized linear models. Full models are typically built up in a stepwise manner from simple models consisting of structural terms, through to the final models designed to test the hypotheses of interest. This is because some more complex models may not be able to be estimated due to combinations of parameters leading to degeneracy (the model placing most of the probability on only a few of the complete set of possible networks, often those that are either completely devoid of edges or completely connected). At each stage, parameter fitting is achieved by simulating networks and comparing them with the observed network. Parameter estimation requires the use of Markov chain Monte Carlo (MCMC). From an initial starting graph, an edge is added or removed at random (in the case of binary ERGMs). If the new configuration of the graph is closer to the observed data then the new graph is taken as the next graph in the sequence, and if it is not then it is only taken as the next graph in the sequence with a low, fixed probability. The MCMC chain is considered to have converged when it has settled into a pattern centred around a particular combination of parameter values. This maximum likelihood estimation of each parameter is calculated by generating values for all parameters that centre the distribution of each parameter fitted on the observed network data (Lusher et al., 2013). Parameter estimation is conditionally dependent on other covariates included in the model (Lusher et al., 2013). This allows one to assess the importance of particular variables (e.g. the tendency for reciprocity) while accounting for other variables (e.g. shared space use). Estimated values for parameters provide an indication of likelihood of that network configuration, given the other effects in the model (Lusher et al., 2013).
Once each model has converged, then goodness-of-fit can be assessed by comparing measures calculated from networks simulated using the fitted model with equivalent measures from the observed network (Lusher et al., 2013). This typically involves measures such as the degree distribution (a frequency distribution of the number of connections that individuals possess), geodesic distances (the length of paths through the network that link individuals) and triad censuses (the frequency of triads, groups of three individuals, with 0, 1, 2 and 3 completed edges). However, any combination of network measures can be used as long as they have not been fitted in the model, preferably either those that provide a good general measure of network structure (such as the three default goodness-of-fit tests detailed above), or measures chosen specifically to capture features of interest to the researcher. As more complicated models are fitted it is important to check that goodness-of-fit improves. Terms that worsen the goodness-of-fit should not be retained, although terms that do not greatly influence goodness-of-fit either way may be retained if they are relevant to particular hypotheses. More formal testing of hypotheses can also be conducted. For example, it is possible to perform backwards stepwise deletion to choose a final model once the full model has been constructed (e.g. Snijders, Pattison, Robins, & Handcock, 2006), using approximate Wald tests to indicate whether certain terms in the model are statistically significant (Lusher et al., 2013). In addition, it is possible to compare fitted models with Aikaike information criteria (AIC) or Bayesian information criteria (BIC) to allow the most parsimonious model to be selected. This could allow the comparison of multiple competing models (assuming convergence) that test different combinations of hypotheses, in a process akin to multimodel inference. It is also possible to use methods of Bayesian model selection such as reversible jump MCMC (Caimo & Friel, 2013).
ERGMs can be implemented within R (R Development Core Team, 2017) and in the standalone java-based software PNet (Wang, Robins, & Pattison, 2009). In R there are number of packages within the statnet  and xergm (Leifeld, Cranmer, & Desmarais, 2016) suites of packages that enable the fitting of ERGMs (see Table 1). Basic ERGMs, including for bipartite networks, can be fitted using the package ergm . We provide an example demonstrating the model output, convergence diagnostics and goodnessof-fit tests of basic ERGM fitted to a toy data set in Fig. 2 (network depicted in Fig. 2a). In this example, there is homophily according to the 'colour' of individuals (red or blue), and a continuous effect of a 'size' variable (indicated by the white node labels) on the likelihood of forming connections (Fig. 2b). Model estimates in binary ERGMs are conditional log-odds estimates. In our example model the (intercept) log-odds estimate for an edge existing is approximately À2.14. However, for every increase in size by unit 1 this increases by z0.16, and if the edge links to individuals of the same colour this increases by z0.94 (with minimal difference for red-red and blue-blue). Trace plots of each Markov chain and density plots for each variable (normal distributions centred on the estimate) show that this basic model converges (Fig. 2c), while the goodnessof-fit plots show that it matches the observed data well, although it is unable to replicate a high frequency of individuals with a degree of 10 (Fig. 2d). The R code for this example is provided in Supplementary material. The package ergm.count (Krivitsky, 2015) permits the fitting of ERGMs to weighted networks, in which edge weights are integer count values. Additionally, a recent development has been the extension of ERGM fitting to all weighted networks with the package GERGM (Denny, Wilson, Cranmer, Desmarais, & Bhamidi, 2016). In these models, edge weights are converted to a value between zero and one through a number of user-selected functions. A further extension to the ERGM framework is the fitting of hierarchical ERGMs that enable the incorporation of local rather than global dependency structures, in the package hergm (Schweinberger, Handcock, & Luna, 2016). Finally, it is also possible to fit ERGMs to temporally dynamic networks in R, using either the package tergm (Krivitsky & Handcock, 2016) or btergm . These allow the ERGM framework to be used to model longitudinal network data arranged as a set of network snapshots (from a single point in time) or aggregated static networks (a static depiction of interactions over a predefined time interval).

HOW HAVE ERGMS BEEN USED BEFORE?
ERGMs have been used previously to answer diverse questions related to animal social behaviour. Ilany, Barocas, Koren, Kam, and Geffen (2013) used ERGMs to investigate 'structural balance' in directed networks of rock hyrax, Procavia capensis, interactions. They found that structural balance, where individuals take on a similar set of social relationships as their current contacts, was a feature of these social groups, and that there was a nonsignificant tendency for more newly arrived individuals to feature in triads (sets of three individuals) that lacked structural balance. Edelman and McDonald (2014)  Edge-wise shared partners to be transitive and stable over time. They also exploited the ERGM framework to model the impact of spatial distribution of individuals, a potentially widely applicable technique which we discuss below. ERGMs have also been used to calculate tendencies of individuals to initiate or receive interactions in social groups of yellow-bellied marmots, Marmota flaviventris, for use in further analyses that related networks of affiliative interactions to age and kinship (Wey & Blumstein, 2010). Two further studies have used ERGMs to model dominance relationships within animal groups. For example, Dey and Quinn (2014) used ERGMs to demonstrate that pukekos, Porphyrio melanotus melanotus, had linear dominance hierarchies. They also demonstrated that the type of dominance interactions (display or physical aggression) differed between the sexes, were driven by differences in status signals (the size of the bill shield) and showed sexual homophily. Dey et al. (2015) also investigated dominance hierarchies, and observed that the dominance networks of cooperatively breeding cichlids, Neolamprologus pulcher, were stable between parental care and nonreproductive periods.
Finally, two studies have used ERGMs to model population social structure. Fisher, Rodríguez-Muñoz, and Tregenza (2016) compared networks of interactions in field crickets, Gryllus campestris, and demonstrated that social structure remained similar over time. More specifically, it was possible to predict network structure between years, especially when the populations were similar in size. Meanwhile, Reynolds, Hirsch, Gehrt, and Craft (2015) used ERGMs to simulate racoon, Procyon lotor, contact networks to model the dynamics of rabies transmission.
These diverse applications demonstrate that ERGMs can be used to model affiliative and antagonistic networks, to analyse differences within and between populations, and to understand dyadic and whole network level processes. Moreover, they can be used in both free-living and captive animals, and can be applied across a range of taxa. However, the applicability of the ERGM framework will very much depend on the questions being addressed and any constraints of the data being analysed, and we highlight the most important of these considerations below.

Advantages
An important strength of the ERGM framework is that it explicitly incorporates the dependence structures that are integral to many animal social networks Pinter-Wollman et al., 2013) and that represent a difficulty with using conventional linear modelling approaches (Croft et al., 2011;Farine & Whitehead, 2015). ERGMs are particularly valuable as it is possible to directly test hypotheses related to the role of emergent network properties, such as transitivity, in structuring interactions (Dey & Quinn, 2014;Ilany et al., 2013). Even in other modelling frameworks designed to be implemented specifically in social networks, such as latent space models and multiple regression quadratic assignment procedures, it is not possible for these to be estimated .
A second advantage of ERGMs is that they model network topology as a response variable, so are ideally suited for questions related to interactions or social relationships themselves, as well as any questions for which the structure of the network is of primary interest. The former could include questions related to homophily (are within-sex interactions more likely to occur than between-sex ones?), or alternatively the number of social relationships (do bold individuals form more interactions than shy individuals?). There is also an important role for questions about network structure in studies investigating the emergent group level properties of individual social interactions, for example the transitive nature of dominance interactions (Dey & Quinn, 2014;Shizuka & McDonald, 2012). In randomization-based approaches one would compare an observed metric, such as transitivity in the above example, with the range of values generated by the null model, and conclude that an observed network is more or less transitive than expected given the null processes. This, however, makes it difficult to assess to what extent transitivity is an emergent property of other predictors of network formation (which may covary with transitivity), rather than a fundamental process driving network structure (as transitivity and cyclicity may well be in dominance hierarchies). Such information is available if correctly specified generative models of network structure such as ERGMs are used.
ERGMs can also be used as generative models of network structure, which offer great potential as tools in animal social network analysis. Once parameters for the model have been estimated, new networks can be simulated using these values. This makes it possible to generate uncertainty around the observed network structure, and facilitates the comparison of network structure between different populations. For example, simulating social network structure for a population using the parameters for the network structure from a different population would allow you to compare the fundamental network structure between these populations, controlling for differences in population size or composition (e.g. Fisher et al., 2016). This might provide a promising solution to the problems in comparing networks between populations and species (Faust & Skvoretz, 2002).

Drawbacks
There are, however, also drawbacks in the application of ERGMs to animal networks, as well as some more general issues that might impact on their use in studying animal social behaviour. First, ERGMs have been developed in the social sciences where there is greater confidence that edges within a network represent true social ties. Therefore, the ability to extend them to studying animal social relationships is uncertain in situations where social relationships are inferred rather than observed, for instance from spatiotemporal co-occurrences. This applies principally to association-based networks calculated by converting a bipartite network of individuals and groups to a social network using the 'gambit of the group' assumption (Whitehead & Dufault, 1999), which has been widely used to construct animal social networks (Farine & Whitehead, 2015). In general, ERGMs may not be appropriate for analysing such networks, at least in the absence of further work to determine the impact that the sampling issues and data structure imposed by these methods has on model outputs.
One possible solution to this is to use ERGMs to model the bipartite networks that link individuals and groups directly, and make inferences about the sociospatial behaviour of individuals in this manner. In situations where networks have been constructed for predefined behavioural interactions (e.g. dominance interactions), there is not the same issue with network ties being inferred. However, care still needs to be taken in incorporating individuals with differing observation times. One solution may be to fit nodal covariates for time spent under observation, or dyadic covariates for time spent jointly under observation, within the ERGM. Alternatively, social relationships may need to be converted to rates of interaction (Whitehead, 2008) or generalized affiliation indices (Whitehead & James, 2015) before being modelled.
A second potential issue with the application of ERGMs (or other statistical network models) to studying animal social networks is related to missing nodes (incomplete sampling of individuals) or edges (not observing all social interactions). The impact of missing nodes and edges on network analysis has received some research focus in a range of fields (Silk, Jackson, Croft, Colhoun, & Bearhop, 2015;Smith & Moody, 2013;Smith, Moody, & Morgan, 2017), although much of this has been on the calculation of network metrics rather than any impacts on hypothesis testing methods (Silk, Croft, Delahay, Hodgson, Weber et al., 2017). Shalizi and Rinaldo (2013) suggested that ERGMs would not be able to accurately estimate structural parameter estimates in subsampled networks; however, they made no comment on their ability to test hypotheses related to differences in individual behaviour in these situations. Although the inferences made about individual differences in behaviour are reliant on relative differences rather than on being able to precisely parameterize the full network, ERGMs should be used with caution in systems where high proportions of individuals or interactions are not recorded.
Finally, there are two disadvantages more generally to the ERGM framework that animal behaviour researchers should be aware of: computationally intensive parameter estimation and degeneracy. The former occurs as a result of exact parameter inference typically being intractable, and therefore relying on Monte Carlo methods. Practically, this limits the size of networks that ERGMs can be used on to those with tens or a few hundreds of nodes (depending on the model being fitted), rather than the large networks generated in some studies of social animals. Degeneracy is a well-established issue in the fitting of ERGMs (Handcock, Robins, Snijders, Moody, & Besag, 2003;Lusher et al., 2013), and means that for certain combinations of parameters the Markov chain Monte Carlo estimation rarely or never converges. In these situations, it can be difficult to fit models in a stepwise fashion. Structural terms involving triads (modelling transitivity within the network) are often especially likely to result in instability and lead to model degeneracy. One possible solution is to attempt fitting hierarchical ERGMs (using the R package hergm) with local rather than strong dependence structures (which restrict dependencies within particular regions of the network), which can reduce problems with model degeneracy, especially in larger networks (Handcock et al., 2003;Schweinberger & Handcock, 2015;Schweinberger, 2011).

POTENTIAL FUTURE APPLICATIONS
As discussed previously, ERGMs offer a flexible framework for testing hypotheses related to edge formation and network topology. As a result, they could be useful in answering a wide range of questions related to animal social network analysis. We focus on a few key areas here, for which ERGMs are likely to be useful but have rarely been applied.

Generating Uncertainty for Modelling Transmission Processes
As previously highlighted, a major advantage of the ERGM modelling framework is that it is possible to simulate networks using the parameters fitted to the originally observed network. This can be used to generate a set of networks that are similar but not identical to the original network (e.g. Fig. 3). Almost all animal social networks are a subsample of the full set of interactions that occur, and the subsequent simulation of dynamic processes on these networks may be subject to error. Therefore, being able to simulate networks fitted with the same set of parameters, which are important in generating the observed network but without its exact structure, offers an important route to robust conclusions when testing hypotheses relating to network topology, such as the factors influencing information and disease transmission within animal populations. For example, Reynolds et al. (2015) fitted ERGMs to contact networks of racoons in different seasons, and used the generated networks to apply simulation models of rabies spread to demonstrate seasonality in disease dynamics caused by changes in contact network structure. The ability to use ERGMs in this way also facilitates comparison in transmission dynamics between species by quantifying differences in network structure between them, and making it possible to simulate dynamic processes more broadly than on the single observed network. A caveat to this is that the usefulness of the simulated networks depends on the goodness-of-fit of the model; poorly fitting models will generate networks that show transmission dynamics unlike the observed one.

Hypotheses Related to Social Dominance
One area where ERGMs have been employed particularly successfully in studying animal social behaviour is in studies of social dominance (Dey & Quinn, 2014;Dey et al., 2015). Existing measures of dominance hierarchies seek to estimate the linearity of hierarchies (De Vries, Stevens, & Vervaecke, 2006;Douglas, Ngomo, & Hohmann, 2017), and operate in the absence of other variables. ERGMs can be used alongside these approaches to provide a useful quantification of the linearity of hierarchies arising as an emergent property of network structure. For example, the terms estimating the importance of transitive and cyclical interactions in an ERGM provide a direct quantification of how tendencies for transitive and cyclical triads contribute to the linearity of a hierarchy (Shizuka & McDonald, 2012). Importantly, these effects can be tested alongside the influence of phenotypic traits such as body size, age and sex, as well as dyadic covariates such as relatedness, which may be expected to play a substantial role in many systems. In addition, the fact that parameters are estimated with standard error while controlling for other possible effects facilitates comparisons of hierarchies between different behaviours (e.g. ritualized dominance behaviours versus agonistic behaviours), or between different species, and offers a great opportunity for effective cross-species comparisons.
The use of ERGMs also enables a very natural extension to considering dominance interactions as temporally dynamic. The use of temporal ERGMs makes it possible to determine the stability of hierarchical interactions over time, which is likely to influence the benefits of hierarchy formation and therefore have important implications for individuals living in groups. Further, it would additionally be possible to consider how changes in traits influence hierarchical interactions, for example whether dominance interactions are more likely to change as individuals get closer in body weight or condition.

Hypotheses Related to Differences in Network Structure
ERGMs quantify network structure by providing parameter values that describe the structure of the network. While these parameters are context specific (i.e. they depend closely on the other parameters included in the model), they do offer a great opportunity to test for differences in network structure between populations or for different types of behavioural interaction within a population. In particular, comparisons of social networks between populations are complicated by many network measures being influenced by the size of the network (Croft et al., 2008). Crossspecies comparisons of network structure using a standardized approach would allow an improved understanding of the more general evolutionary processes and constraints shaping animal sociality. The application of an ERGM framework would enable this to be done while considering system-specific effects that are known to be important by researchers. For example, an analysis exploring the impact of relatedness on the tendency for withingroup behavioural interactions could be completed while controlling for differences between species in how males and females interacted, or the age structure of within-group interactions. The resulting estimate for the effect of relatedness could then be compared across populations or species.

Hypotheses Related to Network Stability Over Time
Temporal ERGMs have not been used in animal behaviour research. There are other methods available to study dynamic networks (Fisher, Ilany, Silk, & Tregenza, 2017;Silk, Croft, Delahay, Hodgson, Weber et al., 2017;Tranmer, Marcum, Morton, Croft, & de Kort, 2015), and the choice of model should be driven by the data available and questions of interest (Silk, Croft, Delahay, Hodgson, Weber et al., 2017). Temporal ERGMs are somewhat similar to stochastic actor-oriented models as both are based on an ERGMtype framework; however, each takes a different approach to modelling network change. Temporal ERGMs have the advantage of being able to accommodate more complex temporal dependencies, thereby not requiring linear change in network structure over time (Silk, Croft, Delahay, Hodgson, Weber et al., 2017). Relational event models in contrast model temporally explicit interaction data, so are less focused on network structure (focusing instead on the temporal dynamics of interactions themselves, albeit in a social context; Tranmer et al., 2015). The stability of animal social interactions or relationships is a topic of great interest (Pinter-Wollman et al., 2013), and in many species long-term stable associations or alliances are likely to be beneficial Gomes, Mundry, & Boesch, 2009;McComb, Moss, Durant, Baker, & Sayialel, 2001). Temporal ERGMs offer an excellent framework to test the stability of social relationships within animal groups. Edelman and McDonald (2014) used an approach similar to that of a temporal ERGM, by using the previous year's network as a dyadic covariate for the current year's network in male long-tailed manakins. They found that the previous year's network was a significant predictor of the current network, indicating that cooperative relationships between males persisted over time. Further, it is possible to use temporal ERGMs to model network change over time according to a user-specified function, allowing the incorporation of nonlinear rates of change. Within this, parameters for the rate of change in social relationships can be linked with dyadic covariates, so that it is possible to test hypotheses that relationships between particular types of individuals are likely to change faster than others.

OUTSTANDING ISSUES
The use of ERGMs in animal behaviour research would benefit from simulation-modelling studies that can provide greater evidence for when their use (and the use of other similar models) is likely to be appropriate. In particular, exploring the impact of subsampling network interactions on hypothesis testing in networks will be especially useful (Silk, Croft, Delahay, Hodgson, Weber et al., 2017). This is ideally suited to simulation modelling approaches in which 'real' scenarios (e.g. realistic levels of missing data) can be generated and then sampled. Theoretical work has suggested that parameter estimates for structural terms are unlikely to accurately reflect the true properties of the unsampled network in these cases (Shalizi & Rinaldo, 2013); however, hypothesis testing may still be appropriate when relative differences are important. A simulation-modelling approach could also reveal whether it is appropriate to apply ERGMs to associationbased networks of animals, and if so how this might be achieved. Two possibilities seem most likely here: (1) using ERGMs of bipartite networks linking individuals and groups, and (2) including terms that can control for biases introduced by the method of data collection (e.g. effects of gregariousness, number of times observed etc.) and ensuring that this can result in accurate parameter estimation and low statistical error rate.

Conclusions
Exponential random graph models have received relatively limited use for studying animal behaviour, but have provided some interesting insights. This is despite animal behaviour researchers only exploiting some of the more basic approaches within this flexible network modelling framework. We have provided an outline of the strengths and weaknesses of using ERGMs to study animal behaviour, and have used this to highlight some research areas both where they offer real potential and where further simulation modelling work is required to examine their appropriateness in testing hypotheses about animal network structure. Together, this information should provide an important guide to researchers hoping to extend the application of ERGMs in the study of animal social networks, and contribute to developing our understanding of the underlying processes driving animal social relationships.