Learning social networks from text data using covariate information

Accurately describing the lives of historical figures can be challenging, but unraveling their social structures perhaps is even more so. Historical social network analysis methods can help in this regard and may even illuminate individuals who have been overlooked by historians, but turn out to be influential social connection points. Text data, such as biographies, are a useful source of information for learning historical social networks but the identifcation of links based on text data can be challenging. The Local Poisson Graphical Lasso model models social networks by conditional independence structures, and leverages the number of name co-mentions in the text to infer relationships. However, this method does not take into account the abundance of covariate information that is often available in text data. Conditional independence structure like Poisson Graphical Model, which makes use name mention counts in the text can be useful tools to avoid false positive links due to the co-mentions but given historical tendency of frequently used or common names, without additional distinguishing information, we may introduce incorrect connections. In this work, we therefore extend the Local Poisson Graphical Lasso model with a (multiple) penalty structure that incorporates covariates, opening up the opportunity for similar individuals to have a higher probability of being connected. We propose both greedy and Bayesian approaches to estimate the penalty parameters. We present results on data simulated with characteristics of historical networks and show that this type of penalty structure can improve network recovery as measured by precision and recall. We also illustrate the approach on biographical data of individuals who lived in early modern Britain between 1500 and 1575. We will show how these covariates affect the statistical model’s performance using simulations, discuss how it helps to better identify links for the people with common names and those who are traditionally underrepresented in the biography text data.


Introduction
The structure between individuals reflecting their social relationships can be represented using networks.In modern society, learning social networks is relatively simple, since accessing information about or from each individual can be done through multiple sources.For example, to learn someone's personal social network, we could either survey them or use information from social media platforms.In an academic setting, co-authorship information from curriculum vitae, journals, or online archives can provide information about collaborations.However, things become more difficult if we are interested in learning a historical social network, for which the potential sources of information are limited.Building networks based on text data may identify less well-known figures in potential social connection positions of influence.In this paper, we will present methodology to unravel (historical) social networks, based on text data.
Previous work on estimating social networks from text data spans different humanities and social science applications.For example, Marsden (1990) and Üsdiken and Pasadeos (1995) use structured surveys and citations respectively to estimate sociological and collaboration networks.Almquist and Bagozzi (2019) uncover the underlying network structure of radical activist groups with British radical environmentalist texts from 1992 to 2003.Their work primarily concentrates on the application of topic models to analyze the text, and they infer a network using text co-occurrence counts.The China Biographical Database Project1 is also a great example of how networks can be extracted from historical documents.This labor-intensive project involved manually listing all the possible expressions of human relations (e.g."A is friends with B") and then searching the text using pattern matching to extract relational links.Social networks can also be estimated from fiction texts: Bonato et al (2016) extract and analyze the social network from three best-selling novels, defining a link between two characters if their names co-appear within 15 words.

Six Degrees of Francis Bacon
Six Degrees of Francis Bacon2 (SDFB) is a recent historical network project, focusing on estimating the social network in early modern Britain during 1500-1700 (Warren et al, 2016).As their text source, SDFB uses biographies from the Oxford Dictionary of National Biography3 (ODNB) and represents possible relationships between people by the number of times the name of one person occurs in a section of the other person's biography, under the assumption that if two people knew each other as more than just acquaintances and/or were colleagues, they are more likely to show up in each other's biographies.Warren et al (2016) uses a Local Poisson Graphical Lasso model (Allen and Liu, 2012) to estimate the social network using these count data, arguing that a conditional independence structure should be considered when constructing these types of historical social networks.This will help distinguish whether two people truly know each other or just happen to be co-mentioned in a document.
There is no doubt that SDFB contributed a rich resource to support humanities research on early modern Britain.However, given this auspicious start, there is room for improvement.For example, in their validation of precision and recall among 12 non-random people, Warren et al (2016) find that the SDFB approach tends to have high precision but relatively low recall.One possible reason for this behavior is that the model only makes use of the co-mention counts but ignores other information available in the text such as individual characteristics (e.g., occupation, social group).According to homophily theory, similar individuals are more likely to connect to each other than the dissimilar ones (McPherson et al, 2001).For example, several studies have shown that people who share similar age, education level (Kossinets andWatts, 2009), occupation (Calvo-Armengol andJackson, 2004), gender and economic status (McPherson and Smith-Lovin, 1982) are more likely to be connected.Indeed, when looking at SDFB's reconstructed network, we can also observe that linked people tend to share some common characteristics.Including information such as last name or profession/social group in the model may help us increase link accuracy.
When adding additional covariates to our network model, there are several factors we need to consider.First, the model should be flexible enough to include the large number and variety of covariates available in historical text data.Second, we need to include possible aggregation of covariate effects.For example, sharing both last name and occupation likely has a different impact on a possible relationship than just sharing last name.
The idea to incorporating additional information into the Lasso regression model is not new.Yuan and Lin (2006) proposed group Lasso to add penalties to groups rather than individuals.Li et al (2015) extended this method to a multivariate sparse group Lasso to incorporate arbitrary and group structures in the data.Their model provided a unique penalty for each node but also include a penalty for each group where the groups could overlap and even be nested.Zou (2006) proposed the adaptive LASSO which uses initial coefficient estimates without regularization to inform starting penalty weights.However, these papers did not include approaches for incorporating additional information into the penalties outside of group structure.
On the other hand, Boulesteix et al (2017) proposed IPF-Lasso which assigns different penalty factors to all independent variables in their model that are a function of external information, and use cross validation to select penalty parameters based on model performance.In a similar vein, Zeng et al (2020) use the Bayesian interpretation of the penalized regression, re-formulating Lasso regression as a Bayesian model.However, these approaches have not been implemented in the Poisson case, which involves different estimation challenges.
In this paper, we explore and extend both Boulesteix et al and Zeng et al's approaches to the Local Poisson Graphical Lasso model in the context of the SDFB project.We will show (1) how to implement the node-wise covariates and information into the network model's penalty factors, (2) two potential methods for estimating penalty factors for potentially a large number of covariates, and (3) how the inclusion of additional information into penalty estimation can significantly improve precision and recall.

Model
We consider text data consisting of n documents with approximate similar length, based on which we aim to learn the social network among p individuals.This type of information can be obtained by manually coding documents or using natural language processing techniques.We assume that if two people are mentioned in the same document, then they are more likely to know (or have known) each other.More specifically, if two people's counts of name mentions in a document, conditional on all other people's mentions, are positive correlated, then this is an indication that they may know each other.Note that even if two individuals are co-mentioned in a document, this may not imply that they directly know each other: they could, for example, have a common acquaintance.For this reason, conditional independence structures are a natural tool for estimating social networks from text data.
Let Y ∈ N n×p 0 be the document by person matrix where Y ij indicates how many times person j is mentioned in document i.Each row represents the counts of all name mentions in a document; each column represents the name mentions for one person across all documents.We denote an observed document by person matrix by y, while Y denotes the random matrix.
The Local Poisson Graphical Lasso model (Allen and Liu, 2012;Warren et al, 2016) is a variant of the Poisson graphical model that enforces sparsity and is estimated locally.The Poisson graphical model assumes that each name count in a document, conditional on all the other name counts in that document, is Poisson distributed.For document i, let Y i, =j denote the vector of name counts for all individuals other than j.The Poisson graphical model can be expressed as with θ ∈ R p and Θ ∈ R p×p (Θ ii = 0 for all i) and where node parameter θ j serves as the intercept and the edge parameters Θ jk indicate the relations between individuals j and k.If Θ jk > 0, then if individual k is mentioned often in a document, j is likely to be mentioned often as well, which is suggestive of a social tie between j and k.The opposite is true when Θ jk is negative.We thus consider Θ jk > 0 as an indication of a social tie between individuals j and k.

Penalty factors
The Poisson graphical model leverages the name count data in text to learn social network information.However, generally, the body of text in which names are embedded is rich with other information that could be indicative of social ties.For example, it is useful to consider demographic information available from the text when reconstructing social networks from text data.People with common characteristics are generally more likely to be connected than those who are not alike.When learning historical networks based on text data, it might be relevant to know, e.g., whether individuals were part of the same family or social group/club, worked for the same company, and whether they lived geographically close to one another.
Here we extend the Local Poisson Graphical Lasso model with a multiplicative factor for the penalty term that depends on individual covariate information inferred from the text.For person j, we define the covariate matrix Z j ∈ {0, 1} p×m , with m covariates, by 1 if person j, person k have an equal value for covariate h, 0 otherwise. (2) We here consider binary-valued matrices Z j , but the approach proposed in this paper is also applicable to real-valued covariates.Examples of these include last name similarity and last name or social group commonality scores.
For each covariate we include a different penalty factor.Thus, for each person j, the penalized Lasso estimators are given by Θj = arg max where Z j * is the matrix Z j with the jth row taken out and prefixed by an allone column vector and α ∈ R m+1 denotes the penalty factor.The first element of α is α 0 , an intercept controlling the overall shrinkage.If two individuals k and j share a common value on a covariate h, the penalty for parameter Θ jk , indicating the link between them, is e α h times the overall penalty.Therefore, if having covariate h in common makes two people more likely to be connected, then α h will be negative.Otherwise, it will be positive.
Birth and death date are covariates that deserve special treatment in this framework, since if two individuals were not alive at the same time, they could not have had a social connection.To address this, Warren et al (2016) removed the links between people who were not alive at the same time post-network estimation.Given our penalty factor structure, we can instead include birth and death year information directly into the model.We set the penalty factor for the lifespan overlap covariate to be infinity and so do not link people with non-overlapping birth and death years.

Estimation
For each person j, we fit a Poisson regression model including an L1 penalty to enforce sparsity.We estimate model parameters via penalized maximum likelihood using cyclical coordinate descent, as implemented in the R package glmnet (Friedman et al, 2010).This method consecutively optimizes the objective function given as part of expression (3) over each parameter while keeping the others fixed, and cycles until convergence.
During estimation, we force the coefficients to be non-negative, as opposed to Warren et al (2016) who estimated a local Poisson graphical model and ignored the negative coefficients after estimation.After estimating the edge parameter vectors for persons j and k, we say that there is a social tie between j and k when at least one of Θjk and Θkj is positive.
Estimating the value of penalty vector α is essential for determining the edge parameters.In the following two sections, we discuss two approaches to estimate the penalty vector: using greedy search (Section 3.1) and using the reformulation of Lasso regression in the Bayesian framework (Section 3.2).

Greedy search
One way to estimate the penalty factor α is by defining a grid of penalty parameter values and evaluating the corresponding models, selecting the values that minimize the prediction error (Boulesteix et al, 2017).However, this approach is generally computationally feasible only when the number of covariates is small (say, no more than four).Greedily searching the parameter space allows for inclusion of more covariates.Our proposed greedy algorithm for α is described in Algorithm 1. Starting with all α h = 0, i.e. no penalty adjustment, the algorithm first iterates over all covariates in random order.For each covariate h and a gridded range of pre-specified α h values, we use cross-validation to choose the baseline α0 (holding all other α h penalty parameters fixed) and calculate the corresponding MSE.We then choose the αh corresponds to the lowest MSE.After randomly iterating through all covariates, the algorithm repeatedly randomly iterates through all covariates again, looking for possible updated αh values, stopping when no further α h tuning leads to a decrease in MSE.
To use Algorithm 1, we need to specify the search range for α h and the step size d.We recommend starting with a search range for α h such as [−1.2, 0.5] (values outside that range have diminishing impact on the multiplicative factor value) and a relatively large step size d (e.g., 0.1).The search range can be enlarged if the margins are hit during the initial estimation.Decreasing the step size d can of course lead to a more fine-grained solution but will depend on any present computational constraints.We could also choose the search range [a n , b n ] using prior information, such as which covariates are expected to be influential and approximately how they might affect the chance of two individuals to be connected.For example, if we know a covariate h is likely Algorithm 1: Greedy algorithm to estimate α associated with an increased chance of a link, we could initially limit the search range of α h to the negative numbers.This type of search range adaptation can also decrease the number of algorithm iterations and computational time.

Bayesian estimation
Lasso estimates can equivalently be derived as the Bayesian posterior modes under independent Laplace priors for the parameters to which shrinkage is applied (Tibshirani, 1996).Therefore, we can use the Bayesian framework to estimate the penalty parameters α.To this end, we complement model (1) with a Laplace prior for the edge parameters: for k = j, Notice that α only influences the penalties on the edges and not the node parameters θ j .We will specify the exact form of b kj later in this section.We here extend work by Zeng et al (2020) on incorporating covariate-dependent penalty factors in the Lasso term in linear regression and linear discriminant analysis (LDA) models to the Local Poisson Graphical Lasso model.We use an empirical Bayesian approach to estimate the penalty parameters α.First, for each person j, we approximate the marginal log-likelihood of α, denoted by l j (α), marginalizing over the coefficients Θ =j,j .The estimate of α is given by α = arg max α p j=1 l j (α). (5) Note that we maximize the sum of the marginal distributions, because we need a global penalty factor over all people instead of for one specific person j.
Since the l j (α) are not convex, we use a Majorization Minimization procedure (Zeng et al, 2020) to estimate α.We then use the α as input for the penalized maximum likelihood estimation of the model, as summarized at the start of Section 3. Since the Poisson regression likelihood and the Laplace prior are not conjugate pairs, there is no closed form expression for the marginal likelihood of α.We here present a general outline of how we approximated l j (α), approximating both the Poisson regression likelihood and the Laplace priorsee Appendix A for the full derivation.First, we apply the log-gamma transformation to approximate the Poisson regression likelihood by a multivariate Gaussian distribution (Chan and Vasconcelos, 2009).In order to avoid log(0) in our derivation, we add 1 to all the observed outcomes y ij , that is, define Second, we assume Θ kj follows the Laplace prior Θ kj ∼ Laplace(0, where σ2 is the estimated variance in Gaussian distribution approximating the Poisson likelihood.We approximate this prior by a normal distribution with the same variance (Zeng et al, 2020), yielding where k is the kth row of the covariate matrix Z j * .Combining the two, we can approximate the log-likelihood of α for person j and find where C α = σ j I 2 + y =j V j y ⊤ =j , y =j denotes data matrix y excluding the jth column, and log(•) is applied element-wise to y * j = (y * 1j , . . ., y * nj ) ⊤ .Integrating this in expression (5), we can estimate the penalty factors.

Simulation study
In order to compare the methods quantitatively, we created a small community (network) as the ground truth for the simulation.The community is similar by design to the SDFB social network, and we assume to have similar available demographic information.When creating the network, we considered three covariates: last name, group membership and birth/death year overlap.Note that we assume that if the lifespan of two people does not overlap (i.e., it is impossible that they physically met each other), then they should not be linked, regardless of all other factors.Below is a description of the general network design: 1. We generate 50 families in the community with 30 different last names (i.e., people with the same last name can be from different families).2. For each family, we randomly generate 5 to 12 people, each with a birth and death year between 1500 and 1600 and a life length varying from 5 to 70. 3. Within a family, among those people whose lifespan overlaps, 50% know each other.4.There are three social groups, A, B and C. Each person is randomly assigned to one of the groups with probability 0.5, 0.25 and 0.25, respectively.5.Among those people whose lifespan overlaps, we additionally create 100, 100 and 50 links within group A, B and C, respectively.6.At the end, we add 300 random links to the whole community.
This design yields 464 people and 1164 links.Figure 1 illustrates a subset of the community with ten families, 100 people, and 158 links.Since our network design yields higher link density within a family/group as compared to the network average, we anticipate all α should be negative, thus lead to a smaller penalty if two people share the same last name or are in the same group.
From Figure 1, we can see the expected network structure associated with families; we expect the absolute value of the penalty factor for last name to be large.The social group covariates might also be significant but should have a relatively smaller effect than last name.Since group B is the densest one, we expect that its penalty factor may be larger compared to the other two groups.If two people's birth/death year do not overlap, we automatically set the penalty to be infinity, leaving us only four covariates to consider: last name, group A, group B and group C. As described in section 2.1, we build a series of covariate matrices Z j using the criterion of whether person j and person k have the same exact covariate h value.
Using a simulation framework adopted from Allen and Liu (2012), we then generate 10 different document-by-person matrices, each with 2000 documents (i.e. of similar size as SDFB).For each matrix, we run the greedy algorithm and Bayesian approach to estimate the best penalty factor α. Since the matrices are all generated from the same network, we assume the α should be relatively similar and reflective of the designed network structure (relatively larger covariates for last name and group B).We then compare the network estimated with no penalty adjustment to the networks estimated with penalty adjustment (greedy, Bayesian) by calculating their precision and recall.Our expectation is that the penalty adjustment allowing for incorporating covariate information into the network estimation will be associated with an improved average of precision and recall.We also examine the predicted 10-family subcommunities in an attempt to characterize how the penalty factors impact the false positives and false negatives.
Figure 2 shows the distributions of |α| from the greedy and Bayesian approaches.All α are negative, indicating if two people have the same last name or social group membership, they are more likely to be linked.(In general, we plot the magnitudes to allow for easier comparison, particularly when we have both positive and negative αh .)The larger the absolute value of |α h |, the stronger the covariate effect is on the penalty.Here we see that the Bayesian approach gives more similar α values across the ten runs, correctly identifying last name as the most important covariate and group B as having a slightly stronger effect than the other two groups.The greedy method gives α values that are more varied and do not reflect the network design.For example, although last name has a non-zero effect, it is not substantially larger than the other αh for the social groups.One potential reason for the consistency differences is that the Bayesian approach is trying to optimize the log likelihood of α while the greedy algorithm tries to optimize the model performance based on the MSE which may find multiple combinations of |α h | that lead to similar results.For example, if two people share the same last name and the same social group, a smaller penalty on either last name or social group or both can help with recovering the link.
For each generated document by person matrix, we also use the αh for both the greedy and Bayesian approaches to estimate the network and calculate the corresponding precision and recall, comparing these values to those for the model without penalty adjustment.Figure 3 shows the resulting distributions for precision, recall, and the average of the two.We see that the model with penalty adjustment has improved precision, regardless of estimation approach, while the recall for all three options remains similar.The slight improvements in the average of the two follow.Now examining the predicted network structure, we see that all three model/estimation approaches overestimated the true number of links in the Fig. 2 The distribution of | αh | estimated by the greedy and Bayesian approaches over ten runs.Both approaches generally pick the last name as the most important covariate.The Bayesian approach tends to give more consistent values while the greedy approach estimates have a larger variance.
original simulated network (1164).On average across the ten document by person matrices, the model without penalty adjustment detects 1662.1 links.With penalty adjustment, the greedy estimation approach averages 1434.7 links, and the Bayesian approach averages 1358.1 links, both an improvement over the original model.
We then take a closer look at the estimated network structure for our ten family, 100 people sub-community (Figure 1) for two of the simulated document by person matrices.For Run 10 (top row of Figure 2), the greedy and Bayesian estimation approaches give similar |α h | for last name, but the greedy approach gives slightly larger |α h | values (in magnitude) for the social group covariates.Therefore, we expect more links between people with the precision recall average NoPenaltyFactor Greedy Bayesian NoPenaltyFactor Greedy Bayesian NoPenaltyFactor Greedy Bayesian 0.6 0.7 0.8 value Fig. 3 The distribution of precision and recall for the model without penalty factor, with penalty factor estimated using the greedy approach, and with the penalty factor estimated using the Bayesian approach.With penalty adjustment, both estimation approaches show an improvement in precision without a substantial change in recall.There is no significant difference on the average of precision and recall between the two estimation approaches.
same group membership when using the estimates from the greedy approach compared to those of the Bayesian approach.
The relevant estimated networks for Run 10 can be seen in Figure 4. We can see that for the network estimated by the model without a penalty adjustment, the false positive links exists across the whole network but with for the network estimated with penalty adjustment, the number of false positive links decreases.The predicted networks with α from the greedy and Bayesian approach are similar, but there are more within-group false positive links for this sub-community with α from the greedy approach.Note that this is in line with the observation that the group-related penalties, for Run 10, are smaller for the greedy approach (and thus the within-group links are penalized less).
We also examine Run 1 where the |α| are quite different between the two estimation approaches (see Figure 2).The greedy method tends to give a smaller penalty for last name but a larger penalty on social groups, although we do note that the |α h | for group B is incorrectly estimated to be smaller than those for groups A, C. The corresponding predicted networks are depicted in Figure 5.The networks corresponding to the penalties estimated by the greedy and Bayesian approach are more dissimilar for for Run 1 than for Run 10, like the penalties themselves.Compared to Run 1, the last name and group B penalties are larger for the greedy approach, leading to the detection of fewer links between people with the same last name or who are both in group B.
In summary, our simulation study gives some evidence that including covariate information through penalty adjustment can improve the performance of Local Poisson Graphical Lasso model in the context of estimating social networks from co-mention/count data derived from text.With respect to differences in the two estimation approaches, we see that the Bayesian approach tends to give more consistent results; however, we note that, given its global

Predicted network with alpha from Greedy method
Predicted network with alpha from Bayesian method Fig. 4 Predicted ten-family community network for Run 10 for the model without penalty factor, with the penalty factor estimated using the greedy approach and with the penalty factor estimated using the Bayesian approach.Grey line: True Positive; Blue line: False Positive; Red line: False negative.Node color: last name; Node shape: social groups.In Run 10, the αh are similar for last name; the greedy approach gives slightly higher values for group covariates.We see fewer false positives using the greedy approach.
estimation and computational tasks (e.g.matrix inverse calculations), it will be slower than the greedy algorithm.

Six Degrees of Francis Bacon: 1500-1575
We illustrate the model proposed in this paper by an application to part of the data used in the SDFB project (Warren et al, 2016), focusing on the period between 1500 and 1575.We compare the results of the models with and without covariate-dependent penalty factors.We consider the interpretability of the penalty factors, how they affect which network links are estimated, and

Predicted network with alpha from Greedy method
Predicted network with alpha from Bayesian method Fig. 5 Predicted ten-family community network for Run 1 for the model without penalty factor, with the penalty factor estimated using the greedy approach and with the penalty factor estimated using the Bayesian approach.Grey line: True Positive; Blue line: False Positive; Red line: False negative.Node color: last name; Node shape: group membership.In Run 1, the greedy approach tends to give a smaller penalty on last name but a larger penalty on social groups which gives us more false positives and a few fewer false negatives within social groups.
approximate the precision of the models with and without penalty factors using Wikipedia as a reference.
We first extract all documents from the SDFB database that contain references to individuals who were born and passed away between 1500 and 1575.This results in 2003 documents on 420 people.Over 83% of them (394) are male, about 8% (34) are female, and for the rest the gender is unknown.Women who appear in these data are usually associated with men in the data through family or marriage.
Apart from last name and birth and death year, we here consider three other covariates, related to individuals' occupation.We distinguish three groups: the Writer group (the occupation variable in the data contains the words "poet", "writer" or "author"), the Church group (occupation contains "church", "religious", "bishop" or "catholic"), and the Royal group (occupation contains "royal", "king", "queen" or "regent").Table 1 includes some descriptives of the data.Since we have limited the data to people who were alive in a period of 75 years, the lifespan of most pairs of people overlapped.Compared to the simulated data, the proportion of pairs with shared last name is much smaller.This indicates a more diverse last name distribution (the most common last name "Stewart" is the last name of royalty during this period and appeared for only 9 individuals, while other last names appeared for no more than 5 individuals), but also suggests that as long as two people shared the same last name, the chances of them belonging to the same family and knowing each other are high.Among all occupations that were listed in the data, the writer and the church-related occupations are most popular.Individuals with a royal-related occupation tend to be closer connected than other people, which is why we consider this group, even though not that many people are part of it.People can have multiple group membership across the three groups.Five individuals are part of more than one group, like Roger Ascham, who was an author and a royalty tutor, and John Seton, who was a Roman Catholic priest as well as a writer on logic.
We estimated the penalty parameters α using the Bayesian approach outlined in Section 3.2.We find that α lastname = −1.853α writer = 0.369 From the size of the penalty factors, the last name is the most important covariate, indicating that if two people share the same last name, this is a strong indication that they may know each other.It is interesting that not for all groups the penalty factor is negative: if two people are both a writer, they are less likely to be connected.It is possible that being a writer is an occupation for which little collaboration is required, so that the writers did not socialize much with their peers.On the other hand, if two people are both related to the church or the royal family, this increases their chance of being linked.
Next, we compare the networks generated by the Local Poisson Graphical Lasso model with and without penalty adjustment.The overall penalty level for both models is the one minimizing the MSE.For the model without penalty adjustment, the estimated network consists of 122 links and for the model with penalty adjustment, the estimated network consists of 99 links.Although they partially overlap, the two networks have also contain many different links.There are 36 links that are only picked up by the model with penalty adjustment picks up and 59 links that are picked up only by the model without penalty adjustment.
How do the penalty factor values α relate to the difference between the two estimated network?To answer this question, we consider the percentage of links estimated by the two that had covariates in common (see Table 2).
As expected based on the negative penalty factor estimate for the last name and the royal group, the model with penalty adjustment picks up more links between people with the same last name or both related to the royal family.To be more specific, the model with penalty adjustment detects four additional links without losing the seven links that were estimated by the model without penalty adjustment model.However, the proportion of links between individuals from the writer or the church group does not differ much between the two models.Both models select one link between two people in the writer group.The model with penalty adjustment even picks one link less within the church group, even though the negative penalty factor α church indicates that links between people within the church group are penalized less.Note that the difference in within-group estimated links only contributes a small portion of the difference among the estimated networks.This suggests that changing the penalty on the links between people within the same groups also affects the links that are not within those groups.
Finally, we approximate the precision of the estimated networks by looking for evidence for links on Wikipedia.For a link involved with two people, as long one of the persons' Wikipedia document contains the other one's name, we consider this as evidence that a link exists.Of the 99 links that are picked by model with penalty adjustment, we find evidence for 59 (59.6%).Of the 122 links that are picked by the model without penalty adjustment, we find evidence for 64 (52.5%).
Of the 59 links that are only picked by the model without penalty adjustment, there are 34 related to three people: Nicholas Bourbon, a French poet, and Margaret Roper and Katherine Seymour, two noblewomen.Nicholas Bourbon only spent one year in the United Kingdom during his life.Even though he did have a strong connection to Anne Boleyn, the Queen Consort, there is no other evidence to suggest that he is connected to the Queen's other acquaintances, even though he may have mentioned those people in his series of poems about the Queen.We find a similar pattern for the two noblewomen: in reality, they did have some strong connections to royalty and other aristocrats, but the model without penalty adjustment incorrectly links them to people who they are connected to only indirectly.The model with penalty adjustment did not detect the links between the noblewomen and the royal group either.Modifying the definition of the royal group or adding a group for nobility could help improve the model's performance.
There is no doubt that an in-depth analysis of these results would require the help from experts on British history, but from these preliminary analyses, it seems that the model with penalty adjustment yields a more precise and conservative estimate of the relationships.

Discussion
In this paper, we have shown promising results to support adding covariate information when estimating social networks from text data using a Local Poisson Graphical Lasso model.This covariate information is incorporated through the L1 penalty: we penalize the parameters representing the edges between two individuals depending on the extent to which they have covariates in common.To estimate the penalty factors, we have discussed two approaches: a greedy algorithm and a Bayesian framework.
Our simulation results indicate that, if there is relevant covariate information, including this in the L1 penalty can improve the sum of precision and recall of the estimated network.We did not observe any significant differences in precision or recall when the penalty factor was estimated by either the greedy or the Bayesian approach.While the greedy approach typically requires less computation time, it does require a prior decision about a reasonable search range for the penalty factor.The Bayesian approach tends to give a more consistent estimate for the penalty factors, but requires more computation time.In the Bayesian approach, we do approximate both the Poisson regression likelihood and the Laplace prior to find the marginal likelihood for the penalty factor.We have not analytically evaluated the effect of this double approximation.However, the simulation study yields that the penalty factor estimated by the Bayesian approach gives results comparable to those for the greedy approach.
We applied the Local Poisson Graphical Lasso model with penalty adjustment to biographical data on individuals who lived in early modern Britain in the period 1500 to 1575, estimating the penalty factors using the Bayesian approach.We find that in these real data, the relation between covariates and linkage probability is not always in line with homophily theory.While individuals with the same last name or with both a church-or royal-related occupation were more likely to be linked, according to the estimated penalty factors, links between individuals who we both authors were actually penalized more heavily.Also, based on Wikipedia as an external reference, we conclude that the model with penalty adjustment could help to recover the social network with higher precision compared to the model without penalty adjustment.Here, we have applied the model to a subset of the SDFB data.The complete SDFB data contain over 19000 documents with references to over 13000 people.Both approaches we have proposed to estimate the penalty factor, and especially the Bayesian approach, will be slow when dealing with large data.Considering other optimization approaches to improve the computational efficiency is an interesting avenue for future research.
We only interpret the positive edge coefficients in the Local Poisson Graphical Lasso model as an indication for the existence of a social tie between to individuals, and have assumed the coefficients to be non-negative in the estimation.When we ran the same models without this constraint and only consider the positive coefficients as an indication of a link, we obtained roughly the same results.However, alternatively, we could have opted for a different model or a different penalty structure/prior, that would do away with the post-processing step.For example, it could be interesting to explore the Bayesian approach with a combination of a Poisson regression likelihood and a Gamma prior.
Finally, in this paper, we only focus on binary covariates.However, there are several continuous covariates that are worth considering when estimating social networks from text data.For example, historical text often contains typos and sometimes spelling variation.Therefore, when identifying whether two people are from the same family, instead of directly comparing their last names, we could consider the similarity of their last names.By measuring name similarity using the Jaro-Winkler distance (Winkler, 1990) and including this in the L1 penalty, a missing letter or a word with the same pronunciation but a different spelling (e.g., "Askham" and "Ascham") will not be over-penalized.Also, in the real data example, we currently only consider how being in the same occupation group should affect the L1 penalty.However, this analysis does not need to be limited to the within-versus between-occupation comparison.We could also include a continuous covariate representing the similarity between occupations (or introduce penalty parameters corresponding to the links between occupation groups).The proposed Local Poisson Graphical Lasso model with covariate-dependent penalty parameters thus provides a rich framework for learning social networks from text data.
with a covariate-depedent Lasso penalty on the Θ kj or, equivalently, a Laplace prior (see expression ( 4)).To estimate the values of penalty parameters α in a Bayesian framework, we here approximate their marginal likelihood.
We first approximate the Poisson likelihood by a normal distribution, using the log-gamma approximation (Bartlett and Kendall, 1946;Prentice, 1974;Chan and Vasconcelos, 2009).Recall a Gamma random variable µ ∼ Gamma At this point, we specify the Laplace prior defined in equation ( 4) by We approximate this Laplace prior by a normal distribution with the same variance (Zeng et al, 2020).That is, we can approximate β j ∼ N (0, 2 τ 2 j ) by β j ∼ Laplace(0, τ j ).Therefore, we can approximate the distribution of edge parameters Θ =j,j by Θ =j,j ∼ N (0, V j ) ( 16) where V j ∈ R (p−1)×(p−1) is a diagonal matrix with V j kk = where y * j = (y * 1j , . . ., y * nj ) ⊤ , y =j denotes y excluding the jth column, and within the norm, λ(•) operates on the columns of y =j and log(•) is applied element-wise.Dropping terms that are not a function of Θ j , expanding the norm term and completing the square within the integral, we obtain that the approximate marginal log-likelihood of α satisfies − l j (α) ∝ log |C α | + log(y * j ) ⊤ C −1 α log(y * j ) (18) where C α = σ j I 2 + y =j V j y ⊤ =j .

Fig. 1
Fig.110-family sub-community (100 people, 158 links), Last names are represented by colors and social groups by shapes.The network shows clear family structure with some social group structure and additional random links.

Table 1
Descriptive statistics of the SDFB data on people from the period 1500-1575.

Table 2
Numbers and percentages of links estimated by the models with and without penalty adjustment, for whom the corresponding people had a common covariate.