Modeling language ideologies for the dynamics of languages in contact

In multilingual societies, it is common to encounter different language varieties. Various approaches have been proposed to discuss different mechanisms of language shift. However, current models exploring language shift in languages in contact often overlook the influence of language ideologies. Language ideologies play a crucial role in understanding language usage within a cultural community, encompassing shared beliefs, assumptions, and feelings towards specific language forms. These ideologies shed light on the social perceptions of different language varieties expressed as language attitudes. In this study, we introduce an approach that incorporates language ideologies into a model for contact varieties by considering speaker preferences as a parameter. Our findings highlight the significance of preference in language shift, which can even outweigh the influence of language prestige associated, for example, with a standard variety. Furthermore, we investigate the impact of the degree of interaction between individuals holding opposing preferences on the language shift process. Quite expectedly, our results indicate that when communities with different preferences mix, the coexistence of language varieties becomes less likely. However, variations in the degree of interaction between individuals with contrary preferences notably lead to non-trivial transitions from states of coexistence of varieties to the extinction of a given variety, followed by a return to coexistence, ultimately culminating in the dominance of the previously extinct variety. By studying finite-size effects, we observe that the duration of coexistence states increases exponentially with network size. Ultimately, our work constitutes a quantitative approach to the study of language ideologies in sociolinguistics.


I. INTRODUCTION
Modeling language shift is valuable because it can unveil the mechanisms that lead to language death or its maintenance [1][2][3].The pioneering model of Abrams and Strogatz [4] assumed that language shift is mostly driven by a prestige parameter, which quantifies the relative strength between two linguistic varieties in contact but with different sociolinguistic statuses [5].When the * prosillo@ifisc.uib-csic.estransition rate for speakers to change their initial language is proportional to the number of people that speak the target language, the only stable fixed point of the model implies the extinction of the variety with the least prestige.Interestingly, the extinction processes of languages have analogs with the evolutionary properties of biological species [6][7][8].
Since then, different mechanisms [9][10][11][12][13][14][15][16][17][18][19] have been proposed to enable the coexistence of varieties seen in reality, which in fact is a rather common situation in multilingual societies [20][21][22][23].For instance, a community of bilingual speakers may help stabilize a fixed point with different fractions of monolingual speakers.Another possibility is to introduce a volatility parameter, which accounts for the fact that a speech community can be more opaque to the influence of speakers with a different variety.However, all these theoretical approaches (reviewed in, e.g., Refs.[24][25][26][27]) do not fully take into account the role of language ideologies, a social factor that is currently considered as as a key concept in understanding language use and attitudes within a cultural group.This is the gap we want to fill in with our work.
Language ideologies comprise a wide spectrum of beliefs, assumptions and feelings that a group of speakers socially share about certain language forms [28].As such, ideologies lead to linguistic attitudes [29,30] and values that express with explicit actions degrees of favor or disfavor toward a language or a variety.These psychological tendencies generate prejudices, stereotypes, biases, etc.A commonplace case refers to languages that have undergone a standardization process in which the standard variety is advocated in school, government offices and mass media against the vernacular variety or dialect spoken in a particular region [31].Typically, this leads to an overt prestige that encourages speakers to use the standard variety by penalizing utterances that depart from the linguistic norms.However, there also exists a covert prestige [32] that describes a positive willingness towards socially considered lower forms due to cultural attachment or group identity with regard to the vernacular variety.This can happen owing to the presence of ethnic differences (e.g., African-American English [33]) or the influence of a third variety (e.g., bilingual Basque-Spanish speakers preferring on average Basque Spanish to Standard Spanish [34]), among other causes.From the viewpoint of mathematical modeling, an equivalent situation considers the competition between a global and a local language (the latter may be endangered), where these two languages are related vis-à-vis with the standard and vernacular varieties indicated above.Further, one could envisage two ways of speaking (young versus old generations, high versus low socioeconomic classes, etc.) associated to distinct sociological parameters.Our theoretical proposal is thus completely general in this respect and just considers two speech communities with different linguistic preferences and two language varieties in contact with different prestige.This way our findings can be applied to a broad range of sociolinguistic situations.
Our model builds upon previous efforts [35][36][37][38][39][40] that consider communities of binary agents with different states.The agents can change their states interacting with their neighbors following predefined rules.As a consequence, the state of the population evolves in time until a consensus is reached (or not).In our case, the state is the language or variety spoken by the agent while the transition rates for variety adoption reflect the influence of the surrounding individuals in terms of the variety prestige and the fraction of those individuals speaking any of the two varieties.Crucially, the agents can have two internal preferences caused by their language ideologies, distinct from their state concerning the spoken variety.Consequently, agents may prefer either their spoken variety or the alternative existing one.These preferences for the standard or the vernacular variety determine in term the values assigned to each variety prestige.In short, the model accounts not only for what language the individuals speak but also what language they prefer to speak.Our findings reveal that in some cases the agents' preference can counteract the force of the most prestigious variety, thus leading to the survival (or even dominance) of the local variety in relation with the standard variety.More strikingly, our model shows a rich constellation of phases-upon increasing of the coupling between the two communities with different preferences we find a transition from a social state where the vernacular (majority) language dominates to a phase where this variety becomes extinct, sandwiched between intermediate regions for which the coexistence between varieties is possible, and finally a phase there the standard (mi- nority) language is dominant across the society.These results can be better understood in the mean field limit where the agents are connected all to all.Yet we also investigate finite size effects with the aid of agent-based modeling and calculate the survival times.Below, we give more details on this complex landscape, which both deepens our knowledge on the dynamics of languages in contact and and may have an impact in the design of appropriate language policies that seek to revitalize endangered languages.

II. MODEL
Our goal is to quantify the influence that the linguistic preference of the speakers may have over the distribution of speakers within the different varieties of a language.For this purpose, we propose a mathematical framework which models a society in which only one language with two different varieties-the standard and the vernacular-exists.As explained in the Introduction, this model is also valid for two languages or for two ways of speaking induced by sociological factors.Therefore, speakers may speak either one variety or the other but they may prefer one variety over the other.Let X (Y ) denote the standard (vernacular) variety while the preference is labeled with 1 or 2. This implies that we have four groups of speakers: x 1 , x 2 , y 1 , and y 2 .On the one hand, x 1 is the fraction of standard speakers that prefer the standard variety whereas x 2 is the fraction of standard speakers that prefer the vernacular variety.On the other hand, y 2 is the fraction of vernacular speakers that prefer the vernacular variety whereas y 1 is is the fraction of vernacular speakers that prefer the standard variety.
This depiction of a society with one language, two varieties and four population groups is the minimal model that captures essentially the influence that preferences have on language shift.
Since we are dealing with population fractions, it is a good approach to consider that our society consists of a large number of interacting speakers.The dynamics of the system when the speakers interact all to all (mean field approximation) is given by the rate equations where the transition rates to shift from variety X (Y ) to variety Y (X) are accordingly proportional to the total number of Y (X) speakers: Importantly, the shift probabilities given by Eqs. ( 5), ( 6), (7), and ( 8) include the parameters s 1 and s 2 , which account for the prestige of the standard variety for the vernacular speakers and vice versa.Quite generally, we take s 1 , s 2 > 0.5 to model the fact that those speakers whose preference is not aligned with their language switch more easily than those speakers whose preference is aligned.For instance, vernacular speakers who prefer to speak language X (i.e., the group y 1 ) change with a rate proportional to s 1 [Eq.(7)] whereas standard speakers who speak their preferred language (i.e, the group x 1 ) change with a smaller rate, since this is proportional to 1 − s 1 [Eq.(5)].This ingredient is absent from previous models and emphasizes the importance of preference alignment or disalignment in language shift processes.
On the other hand, we take s 1 > s 2 to reflect the fact that overt prestige, associated to the higher-status language or standarized variety, is higher than covert prestige, associated to the lower-status language or vernacular variety.However, the mechanism for preference alignment operates similarly as before: those speakers who prefer variety Y (i.e., the group x 2 ) are more likely to shift [Eq.(6)] that those vernacular speakers whose preference agrees with their variety (i.e., the group y 2 ), see Eq. (8).
The fractions in Eqs.(1), ( 2), (3), and (4) obviously obey We note that transitions are not allowed between groups of different preferences.Thus, Eqs. ( 1), ( 2), (3), and (4) constitute a fixed-preference model, meaning a fixed proportion of speakers with a preference for each of the varieties.In Fig. 1 we illustrate the transitions between the different population groups x 1 , y 1 , x 2 and y 2 , which occur only between groups of speakers with the same preference, i.e., x 1 ↔ y 1 and x 2 ↔ y 2 .This is especially relevant for populations that may change their language but not their preference.Of course, preferences can evolve with time but language ideologies are maintained in a population typically over a generation [42], much longer than language change of usage, which can occur at a significantly higher rate [43].Therefore, our results are restricted to time ranges when language shift can take place but preferences are constant.
We define the constant α as the total fraction of speakers who prefer the standard variety, Using Eq. ( 9) this also determines the fraction of speakers who prefer the vernacular variety, x 2 + y 2 = 1 − α.

III. FIXED POINTS
To understand more easily the results, it is convenient to make the change of variables (X, Y, ω, z) = (x 1 + x 2 , y 1 + y 2 , x 1 − x 2 , y 2 − y 1 ) , (11) where X and Y are clearly the total speakers for standard and vernacular varieties, respectively, and ω and z quantify how many speakers of X and Y , respectively, are aligned (or antialigned) with their internal preferences.Due to constraints imposed by Eqs. ( 9) and (10), our original set of 4 independent variables x 1 , x 2 , y 1 and y 1 turns into a set with only two independent variables, chosen to be X and ω.
Thus, the dynamics of the system are governed by the rate equations which are the result of combining Eqs. ( 1), ( 2), ( 9) and (10) properly.
The two terms constituting Eq. ( 12) have a clear interpretation.The first corresponds to the logistic equation, with only two fixed points at X = 0 and X = 1.However, the inclusion of preferences in the second term introduces a new fixed point allowing for coexistence.Due to s 1 > s 2 , the sign of the first term is always positive.Hence, the sign of dX/dt will be given by the second term, since [(1 − 2α)X + (2X − 1)ω] may be either positive, negative or null, and (s 1 +s 2 −1) < 1 holds true at all times.This inequality is guaranteed because s 1 , s 2 > 0.5 and s 1 > s 2 .
We show in Table ?? the analytical expressions for the fixed points of Eqs. ( 12) and ( 13) for these two independent variables X and ω.
Fixed points with IDs E and D imply the extinction of one of the varieties: E describes a situation in which all speakers employ the vernacular variety while D implies that all individuals speak the standard variety.In turn, C implies the coexistence for speakers of both varieties.This is the first remarkable result as compared with Ref. [4], where coexistence is not possible for linear transition rates.The fraction of speakers of each variety and their preference distribution depends on s 1 , s 2 and α.In contrast, extinction and dominance fixed points E and D, respectively, are independent of the parameters of the model.Indeed, they constitute absorbing states in a stochastic simulation.We will later elaborate on this observation when we discuss our agent-based model simulations.
Fixed points of extinction (E) and dominance (D) of the standard variety always exist within the limits of the phase plane, i.e., 0 ≤ X ≤ 1, −1 ≤ ω ≤ 1.However, the fixed point implying coexistence of varieties (C) only lies inside the existence range of the chosen variables when with As for the stability of the fixed points, the two eigenvalues λ 1 and λ 2 of the Jacobian matrix that result from the linearization of the dynamical equations around one of these fixed points are given by Eq. (A1).A computational analysis of the expressions for the fixed points in Table ?? and their stability following Eq.(A1) yields two important results.First, the eigenvalues λ are always real.We can then exclude dynamic states such as cycles.Second, there is always one and only one stable fixed point for each parameter configuration.Depending on the parameters, there will be only one steady state characterised by the extinction of the standard variety (E), its dominance (D), or the coexistence of the two varieties (C).When α < α 1 , extinction of the standard variety (E) is stable, and when α > α 2 standard dominance (D) is stable.
Remarkably, the set of parameters that implies the stability of the coexistence fixed point (C), computed by imposing λ 1 < 0 and λ 2 < 0 for X * = X * C and ω * = ω * C , is also given by Eq. ( 14), meaning that, whenever coexistence is possible, it is stable over time.
We will now investigate the influence of speakers' preferences in the particular state achieved by the system in the long time limit.As we mentioned before, there is always one and only one stable fixed point for every possible value of the triad (s 1 , s 2 , α). Figure 2a) shows an interesting case: despite the fact that the standard variety has a higher prestige, the stable solution corresponds to all speakers using the vernacular variety (E).This is because, for particular values of α < 0.5, the community preference is biased for the vernacular variety.Consequently, a sufficiently low value of α can counteract the strength of a higher prestige variety.Both X and ω are null in this case, as all the standard variety speakers switch to the vernacular variety.In Fig. 2b) we depict an expected case: if s 1 is sufficiently large as compared with s 2 , the preference α cannot prevent the death of the minority language (D), and X = 1.However, the speakers are still biased towards the vernacular variety.In this case, ω * = 2α − 1 < 0, and as ω = x 1 − x 2 < 0, x 2 > x 1 , meaning that there are more standard variety speakers that prefer the vernacular variety.
Figures 2c) and d) are representative cases for coexistence states (C).We can further study their nature as s 1 , s 2 and α vary.Intuitively, for extreme values of the preference parameter such as α = 0 (α = 1), coexistence is not possible, as the absence (dominance) of speakers with a preference for the standard variety drives the system to a state with extinction (dominance) of the standard variety.While α = 0 or α = 1 do certainly not allow for coexistence, 0 < α < 1 may allow for it depending on the value of s 1 and s 2 .
To characterise the phases of the system, we compute the boundaries in phase space which separate the phases of coexistence (C), extinction of the standard variety (E), and its dominance (D).
To compute the boundaries we simply compare the expressions for the fixed points in Table ??, as there is one and only one stable fixed point for each parameter configuration.When X * D = X * C , the sub-index referring to the ID of the fixed point, we are in the transition line between the dominance of the standard variety and coexistence between the two varieties.In this sense, we obtain the dominance-coexistence (DC) transition line Similarly for X * E = X * C , we obtain the extinctioncoexistence (EC) transition line Eqs. ( 15) and ( 16) are both null at s 1 = 0.5, Eq. ( 15) intersects with s 2 (s 1 , α) = s 1 , a limit of the phase space, at s 1 = α and Eq. ( 16) does so at s 1 = 1 − α.This means that when α < 0.5 only Eq. ( 16) intersects with the border s 2 = s 1 ; when α > 0.5, only Eq. ( 15) exists within the limits of the phase plane and it will intersect with the border s 2 = s 1 .We have then a clear distinction of the phase space depending on whether α < 0.5 or α > 0.5.This may be seen in Fig. 3, where we plot the different values of X in the stable fixed point for each parameter configuration, X * st .These values form the phase space for two general values of the preference, α < FIG. 3. Phase space for the model with fixed preferences after an analytical analysis, for a) α < 0.5 and b) α > 0.5, in which the different behaviors of Eqs. ( 15) and ( 16) may be appreciated.The different values of X at the stable fixed point in each parameter configuration, X * st , forms 3 phases consisting of dominance of the standard variety (D), its extinction (E), and coexistence of standard and vernacular varieties (C).0.5 and α > 0.5.Only for α < 0.5 a phase with extinction of the standard variety exists, and in the case of α > 0.5, the greater α, the smaller the area of coexistence.
To better illustrate the influence of α, in Fig. 4 we plot the boundaries of the phase space and the value of X in the stable fixed point for each parameter configuration for three chosen values of α.Fig. 4a) depicts a situation with α = 0.25, i.e., a quarter of the population prefers the standard variety.This allows for the existence of three regions: the extinction of the standard variety if s 1 is sufficiently low and s 2 is sufficiently close to s 1 , the dominance of the standard variety if s 2 is sufficiently low, and coexistence of both varieties for a wide range of values of s 1 and s 2 , with a predominant use of the vernacular variety over the standard one.
Interestingly, Figs.4b) and c), which account for α = 0.5 and α = 0.75, respectively, only show regions in which there exists either coexistence of the two varieties or domination of the standard variety.These figures allow us to observe another direct effect of preferences.As α ≥ 0.5 in Figs.4b) and c), 0.5 ≤ X * st < 1 in the coexistence zone: vernacular speakers will, at best, equal in number the standard speakers.Zones of coexistence in which standard speakers outnumber vernacular speakers are no longer allowed, in contrast to Fig. 4a).Additionally, the region of coexistence in Fig. 4c) has a considerably greater area than the one in Fig. 4b), which suggests that a higher preference for the standard variety has a negative effect on the number of possible parameter configurations which allow for coexistence.
From Eqs. ( 15) and ( 16) we can compute the area of the parameter space with coexistence, σ c st .A straightforward integration yields 1 2 for α < 0.5, and for α > 0.5.Eqs. ( 17) and ( 18) are plotted in Fig. 5.We would expect that the maximum proportion of situations of stable coexistence occurs for α = 0.5, as the proportion of speakers with a preference for one variety or the other would be equal.Nevertheless, we may notice several relevant facts in Fig. 5, where we plot the area in parameter space with 0 < X * st < 1, implying coexistence; with Y * st = 0 implying the dominance of the standard variety, or with X * st = 0 implying its extinction, as a function of α.
Firstly, the maximum of the curve for 0 < X * st < 1 is located at α < 0.5.This makes sense, as the standard variety has a higher prestige than the vernacular one.Because of this, coexistence occurs more probably at values of α which imply a higher preference for the vernacular variety than for the standard one, i.e., α < 0.5.The preference acts as a counterforce against the differences in prestige, and its effect is maximum at α max = 0.27.
Secondly, for α > 0.5 we stop finding stable fixed points in which X * st = 0, as there are more people who prefer the standard variety than the vernacular one, and this in addition to the difference in prestige, prevents the standard variety from losing all of its speakers.
Finally, the curve for the extinction of vernacular variety never vanishes except for α = 0.This happens because of the fixed hierarchy of prestiges, i.e., s 1 > s 2 holds true at all times.As the standard variety is always more prestigious than the vernacular one, it does not matter how high the preference for the vernacular variety is among the speakers: there will always be a set of parameters which lead to stable situations in which the standard variety dominates.This is due to the fact that, as the standard prestige is always higher than the vernacular one, as low as the fraction of speakers with a preference for the standard variety is, it is enough to get to stable situations in which Even though the maximum of the curve is around α = 0.27, the specific range of α in which coexistence is stable considering a particular parameter configuration depends on s 1 and s 2 , following Table ?? and Eq. ( 14).
To sum up, within a model with a large number of speakers interacting all-to-all, the existence of internal preferences due to the speakers' ideology brings the possibility of coexistence between the two varieties with different prestige.This result agrees with the sociolinguistic situation of many countries and regions where different speech communities show distinct language attitudes.However, societies are not generally made up of completely interconnected speech communities.A more realistic approach takes into account different degrees of coupling between speech communities.

IV. DEPENDENCE ON COUPLING STRENGTH
Now, we want to address the following question: How does the level of connection between people with different preferences impact how the system behaves?In other words, we want to investigate the effects of varying degrees of interaction between individuals who have diverse preferences on the overall dynamics of the model.
To do so, we propose a modification of the model with the implementation of a degree of interconnectivity, γ.This parameter γ represents the proportion of all possible links between speakers with different preferences which are actually taking place.
The situation is depicted in Fig. 6.The system is made up of two networks.The speakers of each network have exclusively one preference, i.e., we have a community exclusively of speakers who prefer the standard variety and  ??), which delimits the region of coexistence of speakers of the two varieties.FIG. 5. Area in the parameter space of the stable steady states which imply coexistence, dominance or extinction of one of the two respective varieties, for each value of α.The maximum of the coexistence curve is located before α = 0.5, as the speakers' preference for the vernacular variety counteracts the different prestige of the varieties.The total area of the parameter space is normalized to 1, as indicated in Eqs. ( 17) and (18).
another community exclusively of speakers who prefer the vernacular variety.According to Eq. ( 9), the size of the community with a preference for the standard variety in terms of the size of the total population is α, and the size of the other community is 1 − α.
To study the dynamics of the system analytically, we assume that each community is fully connected.We can then approximate the dynamics by applying the meanfield approach that we followed in Eqs. ( 1)-( 4), rescaling the interactions between speakers with different preferences by a factor γ as an approximation.The new rates then become FIG.6. Illustration of two interconnected networks of varying sizes with coupling between each other.The networks consist of two fully connected speech communities, where individuals share a common preference.Each community is visually depicted by a distinct background color, reflecting the preference for a specific variety.Notably, individuals in these communities have the freedom to use either the standard or vernacular variety for communication, regardless of their preference, as indicated by the node colors.These two communities are partially interconnected by virtue of a fraction of active links γ, which constitute the lines in black color.
As a consequence, the rate equations read whereas the equations for x 2 and y 1 can be obtained from Eqs. ( 9) and (10).Alternatively, we can work with the rate equations We will study X and ω to obtain a global overview of the dynamics of the system and x 1 /α and y 2 /(1 − α) to get insight into what happens inside each community.These two approaches are equivalent, as our system is described only by two independent variables.
In Table II we show the fixed points of Eqs. ( 23)- (26).As in the model without coupling, we find three kinds of fixed points: coexistence of the standard and vernacular varieties (C), extinction of the standard variety (E), and its dominance (D).
For the study of the stability of the fixed points, in Eq. (A6) we show the eigenvalues for the Jacobian matrix.The linear stability analysis of the fixed points yields an important result: as in the model without coupling, there exists always a unique stable fixed point.Thus, we can study stability diagrams as in the model without coupling.
To study the effects of coupling in the phase space of the model we may adopt two approaches.
Firstly, in Fig. 7 we plot the boundaries in s 1 −s 2 space between the different stable fixed points in terms of α and γ.We have computed the boundaries by performing numerical solving.Fig. 7a) shows the phase diagram for α = 0.25 < 0.5, and Fig. 7b) does so for α = 0.55 > 0.5.Both values of α have been arbitrarily chosen and depict the general behavior of the phase space for α < 0.5 and α > 0.5, respectively.
The case with γ = 1, i.e., the case in which both communities are completely connected, is equivalent to the previous model given by Eqs. ( 1)-( 4).Then, we may  ??, and sub-index in X * and ω * stands for the ID of the fixed point.Ther exists a fourth solution for a fixed point, which is not considered further in our analysis as it lays outside our existence range and is never stable.
Phase diagram of X for a) α = 0.25 < 0.5 and b) α = 0.55 > 0.5, as in Fig. 3, in which we plot the boundaries between the different phases for several values of the coupling parameter γ.The curves for γ = 1 reproduce the curves of Fig. 3.The black line delimits the phase space allowed by the restrictions over the prestige parameters.Clearly, the increase in the isolation between the two communities enlarges the area in the phase space which allows for coexistence.
already make an observation on the influence of the coupling in the dynamics of the system: the decrease of γ, i.e., the increase in the isolation between the two communities, enlarges the area of the phase space which allows for coexistence.In other words, an increase in the interconnectivity between communities with opposite preferences decreases the area of the parameter space allowing for coexistence.This is an expected result [44] that our model captures as a validity check.Secondly, we compute the boundaries between the different phases characterised by the stable fixed points in the preference-coupling space, i.e., the α − γ parameter space, in terms of given values of s 1 and s 2 .The mathematical details of their computation are available in Appendix B. In Fig. 8 we may show a representative phase space for the model under two different parameter configurations.There are two boundaries which separate coexistence from either vernacular or standard dominance.If we focus on a single value of α, the variation of the coupling γ allows us to go from one phase to another.For example, let us focus on the case with s 1 = 0. s 2 = 0.6 of Fig. 8.Given a fixed value of α, we can make a transition from coexistence (C) to standard dominance (D) or from coexistence to vernacular dominance (E).We also have the option to remain in the coexistence phase for every value of γ.However, for some other values of the prestige parameters, s 1 and s 2 , γ allows us to witness more than a single transition.In the case of s 1 = 0.58 and s 2 = 0.51 of Fig. 8, for a given set of values of α, e.g., α = 0.15, we may witness several transitions as we increase γ: from coexistence to vernacular dominance, then again to coexistence, and then to standard dominance.This is due to the fact that the boundary between standard extinction (E) and coexistence (C) has a local maximum for γ max at α max .In Appendix B we give further details of its calculation and the parameter sets for which this maximum exists.

A. Regime transitions
As seen in Fig. 8, some parameter configurations allow us to witness three transitions as the coupling of the two communities increases.In the aforementioned case of s 1 = 0.58 and s 2 = 0.51, the line α = 0.15 crosses the boundaries between phases in three intersection points given by γ 1 = 0.13, γ 2 = 0.34 and γ 3 = 0.79 (see Appendix B for details about their calculation).
We now discuss in detail all the regimes in which the system may be found when these three intersection points γ i for i = 1, 2, 3 exist.A graphical illustration of these regimes is shown in Fig. 9.
• Regime I) null coupling: In this regime, γ = 0 and we have two isolated communities in which the only spoken variety is the one preferred by their members.The system is then in phase C, the proportion of standard (vernacular) speakers being determined by the size of their preference community, α (1 − α).This could describe the situation of an elite that occupies a land but, e.g., does not establish relation with the local people.
• Regime II) small coupling: when the coupling is increased to 0 < γ ≤ γ 1 , this little amount of coupling is enough to allow for coexistence due to the influence of each community in the other one.Nevertheless, inside each community, the dominant variety is the majority one.The system remains in phase C.This regime could correspond with the ruling elite increasing the exchanges with the local people.In these cases, there exists a language shift but it is not dramatic.
• Regime III) medium coupling: In this regime with γ 1 < γ ≤ γ 2 , the coupling is enough for the majority with less prestige to dominate over the minority with higher prestige.The system is then in phase E. This could correspond to cases such as the Norman elite, who after the England conquest gradually abandoned their more prestigious French language in favor of the English language preferred by the majority.Another example would be the rise of Hindi (lower status) versus the decline of English (higher status) in present-day India [45].
• Regime IV) reasonably high coupling: Interestingly, the increase in the coupling for γ 2 < γ ≤ γ 3 benefits the prestigious minority in comparison to the previous regime.The system reenters the coexistence phase C and reaches a state in which coexistence is allowed again, but inside each community, the dominant variant is the preferred one among the speakers of the community.There are many examples of this regime nowadays.E.g., in Belgium there are two interacting communities, each keeping their own language.
• Regime V) strong and total coupling: with γ 3 < γ ≤ 1 the coupling is enough for the prestigious minority to dominate in the whole society, so the system arrives to phase D. A historical example of this is the death of many indigenous languages in Latin America, and the survival of Spanish or Portuguese, originally spoken by the ruling minority.Finally, for γ = 1 we recover the results from the first model (Sec.II).
Once the attributes of the different regimes have been described, we will focus on what happens in the system while transitioning from one regime to another using two different approaches.Firstly, by the numerical integration of the rate equations ( 23) and (24) with abrupt changes of γ in time; secondly, by studying the analytical expressions of the stable fixed points in Table II in terms of γ.Thus, we integrate numerically Eqs.(23) and FIG. 9. Interconnection scheme of the two communities depicted as circles.Empty areas refer to vernacular speakers and filled areas to standard ones.The background colour of the communities differentiates between preferences for either standard or vernacular variety, and the intensity of the colour of the interconnection between the two communities refers to a change in γ.As the density of interconnections between the two communities increases, the dynamics inside them changes and different regimes are visited.For some values of the preference and prestige parameters, we may witness several transitions through the increase or decrease of γ.The existence of these transitions is not trivial and leads to reentering transitions.For example, for γ = 0.1 coexistence is possible globally and inside each community, but when the coupling is increased to γ = 0.2, all the speakers switch to the vernacular variety.Again, when we increase the coupling to γ = 0.6, coexistence is again possible.(24) and see how the different regimes are created.One example is shown in Fig. 10, where we can see how the increase of the coupling affects both each group of speakers in Fig. 10a) and the total proportion of standard speakers in Fig. 10b).
The transition from Regime I (γ = 0 in Fig. 10) to Regime II (γ = 0.1) occurs as a result of a rapid decline in the number of speakers of the standard variety (x 1 and x 2 in Fig. 10a)).This decline is attributed to the small size of the community with a preference for the standard variety and its gradual integration into a much larger community that favors the vernacular variety, as in the example of the Norman conquest.As the interconnection between the two communities increases, the transition from Regime II (γ = 0.1) to Regime III (γ = 0.2) leads to vernacular dominance, despite the higher prestige of the standard variety.These regime changes are a direct effect of the interconnection between the two communities.
However, when the interconnection reaches a sufficiently high level, an interesting re-entering transition from vernacular dominance to a coexistence phase (Regime IV with γ = 0.6) takes place.This transition is characterised by a rapid decrease in the number of speakers of the vernacular variety and a simultaneous increase in the number of speakers of the standard variety.Surprisingly, the increase in interconnection now has  23) and ( 24) for s1 = 0.58 and s2 = 0.51 showing several transitions.With letters E, C and D we indicate the phases of standard extinction, coexistence of varieties and standard dominance, respectively.By systematically varying the value of γ, we investigate the transitional behaviour of the system in terms of x1, x2, y1, y2, and X.We change the value of γ close to the steady state.Since time here is finite, the steady states are never reached and therefore, re-entering the coexistence phase from the extinction one (E-C) is possible.In a), the first four variables are normalised by the size of their corresponding communities.For instance, x1/α = 1 signifies that the entire community, with a size of α, predominantly speaks the standard variety.Furthermore, the system's initial state assumes equal distributions of vernacular and standard speakers within each community.
the opposite effect: even though the community with a preference for the vernacular variety is larger than the community favouring the standard variety, the higher prestige of the standard variety noticeably impacts the community with a preference for the vernacular variety, as we can see in the rapid increase in x 2 and decrease in y 2 .Finally, the transition from Regime IV (γ = 0.6) to Regime V (γ = 0.9) demonstrates a clear dominance of x 2 and x 1 over y 2 and y 1 , respectively, as in the case of Latin American countries.
To understand how the system reaches the aforementioned transitions, we may study the variation of the sta- ble fixed point with γ for fixed values of s 1 , s 2 and α.In Fig. 11a) we plot the value of the stable fixed point in terms of γ.As γ increases, we observe the aforementioned phases of coexistence, vernacular dominance and standard dominance, through the change from one regime to another.The interest here relies on the evolution of the steady state while reaching each different phase.For that, we also define linguistic concordance H as which clearly refers to the proportion of speakers who are satisfied because their language and preference are aligned (see the faces of the polygons in Fig. 1).The linguistic disconcordance may be defined as U = 1 − H.These quantities are plotted in Fig. 11b).
The first observation we can make is that the transitions from one phase to another are smooth.The evolution of linguistic concordance shows that an increase in the coupling causes a decrease in linguistic concordance, as the dynamics of the system rely on the eagerness of the speakers to neglect their preferences.However, there is a narrow region just before Regime III (the phase in which everyone speaks Y , so that x * 1,st = 0 and y * 2,st = 1 − α) in which linguistic concordance increases.This is due to the fact that the coupling and the relative sizes of the communities allow, in virtue of P x1→y1 and P x2→y2 [Eqs.(19) and (20), respectively], for a flow from x 1 to y 1 and then from x 2 to y 2 .As 1 − α ≫ α with α = 0.15, the increase of the speakers of y 2 has a greater impact in H than the decrease of speakers of x 1 and the system gets happier to reach the phase with vernacular dominance.
However, reaching a phase with vernacular dominance is not needed for this phenomenon of linguistic concordance momentarily increasing to take place.As we see in Fig. 12a), even for an α greater than the one corresponding to the maximum for which we can observe the vernacular dominance phase, namely α max , there exists a minimum in y * 2,st .This is due to the relative size of the communities.The minimum in y * 2,st is located at γ min , which increases with α as seen in Fig. 12b).Once the minimum in y * 2,st fails to exist, linguistic concordance is absolutely decreasing as the coupling increases.
In summary, the analytical exploration of different phases and transitions in the mean-field model with coupling lays the groundwork for understanding the dynamics of societies with languages in contact.However, this approach is limited by the fact that societies have a finite number of speakers.To account for finite-size effects and intricate details, we complement this analysis with an agent-based model implemented on complex networks.This approach allows us to validate the analytical analysis and investigate the influence of network structures, providing a comprehensive understanding of the aforementioned dynamics in realistic social contexts.

B. Finite-size effects
We have thus far neglected fluctuation effects since populations are assumed to be large.The results of our deterministic approximation are valid in the thermodynamic limit of infinite systems.To model a more realistic substratum, we now proceed by conducting agent-based simulations of the model, implementing coupling in complex networks.By doing so, we can explore and validate our previous findings while also examining finite-size effects on the dynamics of language competition.
To this purpose, we define a network of N nodes con- stituted by two fully-connected sub-networks (the socalled communities) with a fixed preference for standard or vernacular variety.Their sizes are N 1 = αN and N 2 = (1 − α)N , respectively.
These sub-networks are connected following a random process of link assignment between speakers with different preferences, as in Fig. 6.For that, we activate a fraction γ of all the possible links between speakers with different preferences; the number of active links, N a , is given by The simulation of the model with coupling in the aforementioned networks takes place as follows.Each Monte-Carlo step of the simulation consists of a sequential update of all the nodes in the network.The change of the state of an agent during an update depends on a transition probability given by Eqs. ( 19)-( 22) but changing the variables of the proportions of speakers by the local densities of each kind of speaker within the neighbourhood of the agent to update, i.e., those agents who are connected with a direct link to the agent to update.
In Fig. 13 we plot the phase diagram for X as a result of simulations with different sets of parameters.We can see a clear agreement between the simulations in networks and the mean-field approach shown in Fig. 8, meaning that the conclusions drawn from the analytical analysis of the rate equations are valid.
However, a main difference between the rate equations description and the finite size simulation is that the phases D and E are absorbing states of the stochastic dynamics, C is not an absorbing state and a finite size fluctuation will eventually take the system from phase C to either E or D. These absorbing states imply the extinction of either of the varieties, which can have significant societal implications.The relevant question is then: what is the lifetime of phase C for a finite system?As we can see in Fig. 14, survival times scale exponentially with network size and the exponential growth decreases with coupling, meaning that the coexistence between varieties in a society with a given size has a lifetime which decreases as the interconnection of communities with different preferences or social mixing increases.

V. CONCLUSION
To sum up, we have explored the role of speakers' linguistic preferences in contexts that involve language shift.We did so by proposing a model for two language varieties in contact, accounting for the preferences that speakers may have towards one variety or the other.We We measure the survival time as the first Monte-Carlo step in which the system reaches an absorbing state.Coexistence states survive a time that scales exponentially with network size.The time increases more quickly for higher coupling strengths.The maximum mean relative error is 15 %. have first considered, within a mean field approach, the case of a fully connected population.We have shown that although the standard variety is always more prestigious than the vernacular variety, the speakers' preference quite generally determines the dynamics of the system, allowing for language coexistence in situations in which prestige alone would have led the system towards the extinction of the vernacular variety.
Secondly, we have considered a varying degree of interconnectivity or coupling between the two speech communities with different preferences.The degree of coupling measures the extent to which the two communities communicate with each other.We have found that increasing coupling implies that language coexistence is less likely.This is due to the fact that a stronger connection between speakers with opposing preferences favors the more prestigious variety while reducing the number of individuals aligned with their internal preference.
By increasing the coupling parameter, for fixed prestige values and fixed sizes of the communities with different preferences, we have identified transitions between extinction, dominance, and coexistence phases, which could be applied to real-world scenarios.For example, today's linguistic coexistence in Belgium is allowed in spite of a reasonably high coupling.Additionally, historical sociolinguistic events such as the disappearance of Old French in England or the deaths of many indigenous languages in Latin American countries depend not only on the prestige but also on the coupling degree between the speech communities.
Beyond the mean-field approximation, we have also conducted agent-based simulations of the model on complex networks.These simulations validate the mean-field results and allow for the study of finite-size effects.Remarkably, we have found a nice agreement between the network simulations and the results obtained from the mean-field approximation as far as the behavior with preference and interconnectivity is concerned.We have also found that the lifetime of the coexistence states depends exponentially on system size.
Our model has a number of limitations.First, it considers that the society is spatially homogeneous.However, the varieties spoken in urban and rural areas differ along with their prestige and preferences [46,47].Therefore, there is considerable latitude for the incorporation of the spatial degree of freedom in our model [22].Further, it would be interesting to study the dependence of our results on the interconnectivity within each community.Another limitation is that we do not consider bilingual speakers that are known to alter the transition rates of the model and consequently their fixed points [11,12].This could be fixed by adding a third population to the dynamics.Finally, we neglect the extent of volatility [4,48] and interlinguistic similarity [10], which could be modeled with a parameter scaling the transitions.
More importantly, to achieve predictive power one would require reliable data on language usage evolution and language preference.Available fieldwork data are sparse and restricted to small networks [49].Social digital datasets have much larger sizes but they are subjected to biases [50,51] and it is not clear to us how to operationalize both language prestige and individual preferences thereof.Nevertheless, this is indeed an interesting research avenue that we plan to explore in the future.
Overall, we highlight the importance of other sociolinguistic parameters beyond the well studied effect of language prestige.In this paper we have discussed the relevant effect of language ideologies and the different degrees of interconnectivity between speech communities.Our findings might have practical implications, especially for policymakers, particularly in the context of minority language preservation and language planning [52] for contemporary societies.
Note that Eqs.(A1) and (A2) depend only on the parameters and on the specific values of X * and ω * , because Y and z can be eliminated using Eqs.( 9) and (10).
The fixed points in Table II  They only depend on the parameters and on the spe-cific values of the fixed points X * and ω * .

FIG. 1 .
FIG. 1. Schematic illustration of the model with fixed preferences.The society consists of a large number of speakers who engage in communication with all the other members.Speakers have a fixed internal preference (denoted by their shape, square or triangle) and may speak any of the two varieties (denoted by their color, orange or blue).As their preference is fixed but their spoken variety may change, transitions only occur between population groups with the same preference, i.e., x1 ↔ y1 and x2 ↔ y2.These population groups may have different sizes, determined by the preference parameter α = x1 + y1 = 1 − x2 − y2.The polygon idea is inspired by Ref. [41].

FIG. 2 .
FIG. 2. Phase portrait for different configurations of the model with preference α = 0.27.In red we plot the location of the stable fixed point.a) For s1 = 0.7, s2 = 0.68 we show a situation of the death for the standard variety since the stable fixed point is located at X * = 0. b) For s1 = 0.8, s2 = 0.55, conversely, we depict the death for the vernacular variety because the stable fixed point implies X * = 1.Both situations c) with s1 = 0.8, s2 = 0.6 and d) with s1 = 1, s2 = 0.85 show coexistence of both varieties.

FIG. 4 .
FIG. 4. Phase space for three different reference values of α.We plot the value of X in the stable fixed point following the colour scale in the right for a) α = 0.25, b) α = 0.5 and c) α = 0.75.This value and the fixed point to which it corresponds change depending on the values of s1, s2 and α.In dashed lines we plot the transition line from one fixed point to another (see Table??), which delimits the region of coexistence of speakers of the two varieties.

s 1 FIG. 8 .
FIG.8.Phase diagrams for different values of the prestige parameters s1 and s2.We can see three global phases of coexistence (C), standard variety dominance (D) or vernacular variety dominance, i.e., standard variety extinction (E).Dashed lines represent the boundaries between E and C phases while continuous lines represent the boundaries between C and D phases.

FIG. 10 .
FIG.10.Numerical integration of Eqs.(23) and(24) for s1 = 0.58 and s2 = 0.51 showing several transitions.With letters E, C and D we indicate the phases of standard extinction, coexistence of varieties and standard dominance, respectively.By systematically varying the value of γ, we investigate the transitional behaviour of the system in terms of x1, x2, y1, y2, and X.We change the value of γ close to the steady state.Since time here is finite, the steady states are never reached and therefore, re-entering the coexistence phase from the extinction one (E-C) is possible.In a), the first four variables are normalised by the size of their corresponding communities.For instance, x1/α = 1 signifies that the entire community, with a size of α, predominantly speaks the standard variety.Furthermore, the system's initial state assumes equal distributions of vernacular and standard speakers within each community.

FIG. 11
FIG. 11. a) Stable fixed points x * 1,st and y * 2,st scaled by the sizes of the communities with different preferences in terms of γ and b) evolution of the linguistic concordance and disconcordance with the increase of the coupling, for s1 = 0.58, s2 = 0.51 and α = 0.15.

10 FIG. 12
FIG. 12. a) Plot of y * 2,st in terms of γ for different values of α and b) location of the minimum -if existing -of y * 2,st in terms of α.Both a) and b) are computed for s1 = 0.58 and s2 = 0.51.The existence of a minimum in y *2,st is not subjected to the fact that α < αmax = 0.157, as the value of α for which the minimum stops existing, namely αex = 0.184, is greater than αmax.

FIG. 13 .
FIG. 13.Phase diagram of X for s1 = 0.7, s2 = 0.6.With black, discontinuous lines we plot the boundaries between different phases determined by the value of the stable fixed point for each parameter configuration, as in Fig. 8.The lines are plotted over the results of a simulation of the model in a complex network of N = 10 3 nodes and for t = 10 4 Monte-Carlo steps.The color values are calculated as an average over 5 realizations.

γ
FIG.14.Survival time (in Monte-Carlo steps) of coexistence states in terms of network size and coupling strength for α = 0.4, s1 = 0.7 and s2 = 0.6, i.e., the left configuration of Fig.13.We measure the survival time as the first Monte-Carlo step in which the system reaches an absorbing state.Coexistence states survive a time that scales exponentially with network size.The time increases more quickly for higher coupling strengths.The maximum mean relative error is 15 %.

TABLE I .
Fixed points for the dynamical model with fixed preference α.From X * and ω * one can find the value of Y * = 1 − X * and z * = ω *

TABLE II .
Fixed points for the model with coupling.ID stands for the identifier of each fixed point as in Table