text:
# Regional influences on community structure across the tropical-temperate divide

## Abstract

Many models to explain the differences in the flora and fauna of tropical and temperate regions assume that whole clades are restricted to the tropics. We develop methods to assess the extent to which biotas are geographically discrete, and find that transition zones between regions occupied by tropical-associated or temperate-associated biotas are often narrow, suggesting a role for freezing temperatures in partitioning global biotas. Across the steepest tropical-temperate gradient in the world, that of the Himalaya, bird communities below and above the freezing line are largely populated by different tropical and temperate biotas with links to India and Southeast Asia, or to China respectively. The importance of the freezing line is retained when clades rather than species are considered, reflecting confinement of different clades to one or another climate zone. The reality of the sharp tropical-temperate boundary adds credence to the argument that exceptional species richness in the tropics reflects species accumulation over time, with limited transgressions of species and clades into the temperate.

## Introduction

Discrete differences between the fauna and flora in different regions of the world have led biologists to delineate a nested hierarchy of biogeographic regions1,2,3,4. Starting with metrics of species turnover across space (beta diversity), Holt et al.2 identified 20 zoogeographic regions within which species are on average relatively closely related to each other, more so than between regions. These zoogeographic regions are nested within 11 larger realms, and due to strong barriers to dispersal imposed by oceans, boundaries of regions are often coincident with the boundaries of continents5. The long separation of different continents has therefore led to the more or less independent evolution of distinctive biotas (the collection of species that characterize the biogeographic region). However, other partitions between zoogeographic regions and realms have been drawn within continents, notably associated with tropical and temperate climates2. With no obvious barriers to dispersal, these realms must intergrade to some extent6,7. Indeed, a line delineating realms on continents may indicate sharp turnover in species composition or merely lie at a point of balance within a continuous gradient of compositional change7.

A long independent history of species accumulation in tropical and temperate climatic regimes (here defined as locations separated by the line of regular freezing) is implied if turnover between these realms is sharp, in much the same way that biotas on different continents have evolved independently. Such an independent history is integral to many models to explain differences in species composition and richness between communities in the tropics and the temperate8,9,10, yet evidence has been elusive. Evolutionary transitions in both plants11 and birds12 regularly occur across the tropical–temperate boundary, calling the historical discreteness of tropical and temperate biotas into question. Here, we introduce a method that ascribes species to biotas based on their geographical patterns of co-occurrence and subsequently assigns biotas to locations, crucially allowing multiple biotas to contribute to a single location. The method allows us to conceptually separate biotas (reflecting co-occurring species) from realms (where these biotas are found), ascertain the degree of intergradation between realms, and quantify the contribution of species to biotas and of biotas to both realms and local communities. Working with birds, we evaluate the extent to which realms intergrade, focusing on the tropical–temperate boundary. We combine these observations with a local study of this boundary by examining regional affinities of local communities across the steepest tropical–temperate gradient in the world, that of Himalaya.

Our methods extend Grade of Membership models13, which allow the units of analysis (e.g. species or geographic locations) to have partial membership in multiple clusters. These probabilistic models are used extensively in population genetics14 and Natural Language Processing15 and have also been applied in ecology16. By contrast, previous approaches to partitioning global diversity have used hard clustering techniques where by a locality can only belong to one realm2,3,4,17. In the Grade of Membership model, the species present at each location consist of a proportional mix of all biotas. The method achieves this by simultaneously inferring clusters of co-occurring species, which we term species motifs (equivalent to biotas), and the proportional contribution of each motif to a location; this inference therefore defines the biogeographic units (e.g. realms) and their inter-digitation. The motif contributions can be visualized on a map, identifying regions of mixture and patterns of turnover, thereby summarizing geographical structuring of the realms. We use the general term motif because the same analytical framework can be applied to other features of biodiversity, including whole clades and species abundances in communities, as we show below.

To infer species motifs, as in previous studies of realms2,3,4,17, we start with an N × G data matrix of 0s and 1s denoting the absence and presence18 of all terrestrial breeding bird species (g = 1, 2, …, G, here G = 9518) resolved to 1° × 1° across the globe (n = 1, 2,…, N; here n = 17,441), respectively. We fix the number of motifs (K) a priori and estimate (1) the probability of membership of the gth species in the kth motif (θkg) and (2) the proportional contribution of the kth motif to the nth map cell (ωnk, Supplementary Fig. 1 illustrates the general method). The ωnk values are displayed using a spatial STRUCTURE plot19 where each cell contains a pie chart whose colours indicate the proportional contributions from each motif. We fit the model for many different values of K (K = 2…35) to compare motifs according to different levels of partitioning. We also computed motifs on the transposed data matrix, where the rows define species and the columns define sites, resulting in a clustering by shared locations20,21,22. Results are reported in Supplementary Fig. 2 and are consistent with those described in the main text.

The methods allow us to bring together data from global biogeography and local community ecology—data that are usually considered separately—into one analytical framework to evaluate the reality of geographically cohesive biotas. At the global scale, we find that transition zones between regions occupied by tropical- or temperate-associated biotas are often narrow and appear to be concomitant with a line of regular freezing, here defined as locations where the mean minimum temperature of the coldest month is < 0 °C. To evaluate consequences at the local level, we show that bird communities in the Himalaya below and above the freezing line are largely populated by different tropical and temperate biotas with affinities to tropical South Asia (India and Southeast Asia) or to temperate Asia (e.g. central and northern China), respectively. We find that the importance of the freezing line is retained when clades rather than species are considered, implying a deep history to these patterns.

## Results

### Global species motifs and the line of regular freezing

Across the world, most species motifs contribute to geographically cohesive locations, recapitulating zoogeographic regions (Fig. 1). These are generally similar to those identified in earlier studies, but there are differences. For example, even when K = 11, sub-Saharan Africa falls into two motifs, bounded approximately by the tropics, whereas Holt et al.2 considered this entire region to be 1 of the 20 zoogeographic regions, perhaps because species that span both areas contribute to their metric.

Turnover of motifs within continents often correlates with climatic gradients5 (e.g. in precipitation across the southern edge of the Sahara, see black motif in Fig. 1a), but the width of transition zones varies greatly. As can be seen in Central America (orange to blue in Fig. 1a), South America (southern border of orange), and South Asia (pink to purple), a relatively sharp turnover corresponds approximately to the line of regular freezing (compare Fig. 1a, b with Fig. 1c), with possible additional contributions from historical barriers and precipitation5. Turnover between tropical- and temperate-associated motifs in mountainous regions is exceptionally steep, similar to that demarcating continental boundaries. The tropical–temperate partition persists across values of K from 5 to 35 (e.g. Fig. 1a, b), i.e. arises early in the partitioning and persists through further partitions, which more or less subdivide previously identified realms. The generally steep and persistent turnover across the tropical–temperate boundary contrasts with more continuously varying patterns that arise within the tropics or temperate (e.g. across Central Asia or North America, Fig. 1a, b).

In Asia, the freezing line runs right along the Himalaya (Fig. 1) at ~1500 m (east) to 1700 m (west) (Supplementary Fig. 5e). Ficetola et al.5 inferred that the turnover of species across the Himalaya was due to both barriers imposed by the mountains themselves (i.e. orography) and climate. The coincidence of the motif boundary with the freezing line implies a strong role for climate (temperature). Here, locations associated with one motif appear to be separated from locations associated with the other motif by only a few kilometres and no obvious barriers, which makes this the ideal location to assess a realm boundary that is associated with the freezing line.

### Geographical associations of local communities across the Himalayan elevational gradient

To examine the fine structure of this boundary and how it impacts local communities, we conducted field studies at all elevations across both the east and west Himalaya. We censused bird communities on 38 five ha. sites (Fig. 2a). Unlike the global analysis, we are now restricted to these 38 sites, and yet the questions we address require that we input a broader geographic context. To incorporate geography, we define each community based on its dispersion field, which is the number of species from that community found in each map cell21,23,24 (see Supplementary Fig. 3 for a visualization.). Input for this analysis is again an N species × G map cell matrix (Supplementary Fig. 1 illustrates the method explicitly for this case.). Here, each row represents each community’s dispersion field (n = 38 rows), and the cells in the matrix are populated by the numbers of species, rather than 0s and 1s. Hence, we use an underlying multinomial distribution rather than binomial distribution. In this case, clustering depends only on the extent to which communities have similar dispersion fields and is agnostic with respect to species identity. For example, high elevation dispersion fields across the entire Himalaya look very similar (Supplementary Fig. 3) even though associated communities may share only 50% of their species.

We refer to the motifs generated by this analysis as geographical motifs. Geographical motifs are defined by a weighted contribution of map cells (θkg). The influence of a region on a community is then defined by the proportional contribution of the kth geographical motif to the nth community’s dispersion field (ωnk). This analysis is robust to the precision of range maps (see “Methods”). Given that the global analysis of species motifs suggests the collision of two motifs along the axis of the Himalayas, we start with an assessment that sets K = 2, which also has the highest statistical support (Supplementary Fig. 4 gives model output with values of K = 2…5). Proportional contributions of each geographical motif to each community are shown in Fig. 2a, where communities are arranged by elevation along two gradients, one in the east and one in the west. Consistent with the global analysis, turnover is by elevation, not by geography, and occurs between 1200 and 1800 m, i.e. straddling the freezing line (green–grey in Fig. 2a; Supplementary Fig. 5e). This consistency is one line of evidence that motifs are defined by transition between freezing and non-freezing conditions. In particular, with western and eastern sites separated by >1000 km, one might expect geographical distance to partition the system into eastern and western components, but the elevational partition dominates. In Supplementary Fig. 6, we illustrate the underlying causes of the patterns for one group, that of the larger minivets (Pericrocotus). In the east, the elevational ranges of three species are largely below the freezing line, and one lies above. The one above and one of those below extend all the way to the west. Largely because of these long thin ranges, measures of beta diversity25 for whole communities imply a 5000:1 rule, whereby 1 km in elevation generates as much community turnover as 5000 km in geographical distance (least-squares regressions of phylogenetic distance against elevational distance: β = 1.24 × 10–2 units/km and geographic distance: β = 2.56 × 10–6 units/km, Supplementary Fig. 6).

Maps in Fig. 2b show the proportional contribution of each cell to the two geographical motifs. A temperate motif extends out of the Himalaya to the mountains of western China and a tropical motif extends into peninsular India and Southeast Asia. High elevation communities from the west have similar dispersion fields to those from the east (Supplementary Fig. 3). Evidently, a temperate fauna associated with western China tracks climate across the Himalaya, perhaps because no Pleistocene refuge existed to the west12,26. At lower elevations, tropically adapted species have colonized from the plains. Especially across the lower elevations, precipitation regimes differ, with India being generally drier than Southeast Asia (Supplementary Fig. 5). The influence of these climatic differences becomes apparent at higher values for K (Fig. 3d). Two of the motifs now split low elevations between the west and east. The associations of the motifs with precipitation are shown in Supplementary Fig. 5b–d. The appearance of the west and east motifs may be linked not only to precipitation12 but also to mountain barriers26, which have been previously correlated with species range extensions from east to west. However, given the primacy of the elevational split at low values of K (e.g. K = 2), these effects are clearly of lesser importance than controls driven by climatic (temperature) turnover along the elevational gradient, and in particular the transition from tropical- to temperate-associated motifs across the freezing line.

If communities are strongly affected by the climatic regime in which they are embedded, we predict that species from one motif (e.g. tropical) that are present in the other regime (e.g. the temperate) should be at relatively low abundance. To test this prediction, we clustered communities not by their dispersion fields but by the species they contain and those species’ abundances. Here, the columns are all species encountered at least once (G = 304 species), the rows are the n = 38 communities, and the cell entries are the number of individuals of the species censused in the community. We term the clusters produced species abundance motifs (note that 0 values also contribute to this assessment). θkg is the proportional contribution of the gth species to the kth motif, and ωnk represents the proportional contribution of the kth motif to the nth community’s species abundance distribution. Figure 3a visualizes results for K = 4 (see Supplementary Fig. 4 for K = 2 to K = 5). In all cases, the species abundance motifs (Fig. 3a) are largely congruent with the geographical motifs (Fig. 3c). Most importantly, a transition between distinct species abundance motifs is concomitant with turnover between tropical and temperate climates and is sharp for each value of K reported (Supplementary Fig. 4). As a further evaluation of the putative influence of freezing when K = 2, we generated competing model fits where we preset the line of partition at varying elevations and compared those fits to the original Grade of Membership model fit. We found strong support for the original model fit using this method (Supplementary Fig. 7). Finally, a post hoc analysis of the θkg vectors, which measures species contributions to motifs (Supplementary Data 1) shows that individual species are most often associated with one motif, revealing strong compositional differences between motifs.

When K = 4, the top contributing species to each species abundance motif lie along orthogonal axes defined by elevational and east–west partitioning, with many species again uniquely contributing strongly to each motif (Supplementary Data 1). The geographical distribution of these motifs can be visualized in an interactive network of species co-occurrences (Supplementary Fig. 8). Species abundance motifs match those of the geographical motifs with K = 4 but show sharper turnover along the elevational gradient (compare Fig. 3a, c). Species abundance motifs also show sharper turnover than they do when species motifs are inferred based on presence/absence irrespective of abundance (Supplementary Fig. 9). These findings support the prediction that species sourced from one region generally have low abundance when they occur in a community sourced primarily from another region.

Results so far suggest a structuring of biological communities according to the climatic regime in which they are embedded (Fig. 2a, Supplementary Figs. 2, 5). If this is to contribute to broad-scale differences between the temperate and the tropical regions, such structuring should have a deep phylogenetic imprint10,27. To evaluate this, we generated phylogenetic motifs, continuing to weight by abundance. For each community, we summed the abundances of all species belonging to a given clade and proceeded as in the species abundance motifs. Clades were defined with respect to a given time slice in the phylogeny (Supplementary Fig. 10). Even at the 20 Ma timeline, where the collapsed phylogeny has just G = 67 tips, the ensuing phylogenetic motifs show strong structure, which matches that of the geographical and species abundance motifs (Fig. 3; Supplementary Fig. 4). The distribution of phylogenetic motifs along the elevational gradient reflects restriction of whole clades to below or above the freezing line. For example, within the passerines Cyornis flycatchers at low elevation are replaced by ecologically similar, higher elevation Ficedula flycatchers. Nonpasserines tend to appear below the freezing line28, and groups such as the barbets, Megalaima, are only found up to the freezing line. Given the persistence of the overall pattern, we conclude that the effects of climate in shaping modern communities have a deep history.

## Discussion

Our analyses of the different motifs reveal a consistent pattern of partition between temperate and tropical climates. Our conclusions draw on the combined assessment of geographical, compositional, and phylogenetic axes of diversity and comparisons of the model fits for different values of K. As has been discussed widely in the population genetics literature29,30, we do not consider that there is a best value of K for any one of these axes nor that values of K with lower support are biologically meaningless, especially because significance is tested against an unclear sampling distribution. Rather, additional partitions are of value in assessing the hierarchy of contributions of biotas to realms and communities.

Across many environmental gradients, including within the Himalaya, community taxonomic composition appears to vary more or less continuously, both across elevation and geography (e.g. Supplementary Fig. 6). Based on observations such as these, Ricklefs31 argued that continuous turnover implies communities are artificial constructs, whose structure is heavily impacted by dispersal from elsewhere. Results presented here imply a more integrated local community than may be inferred from species lists. First, common species are shared over parts of the gradient, overlapping with common species that are present in other communities, thereby generating a network that can be partitioned into well-supported motifs. For example, most communities contain a common species of sunbird, which occupies a well-defined ecological niche. Most communities also contain one to several small warblers, occupying a different but again well-defined niche. Thus functional similarity of communities extends across the entire gradient. Turnover of species along the elevational gradient is not coincidental across the two groups, but in both cases different species are found above and below the freezing line. Second, if dispersal strongly affects community structure, then communities associated with more than one geographical motif should show elevated species numbers and phylogenetic diversity with respect to communities associated with just one geographical motif. We found no support for this (Supplementary Fig. 11). Species richness varies idiosyncratically both within and between motifs. Phylogenetic diversity monotonically declines with elevation, reflecting the increasing dominance of a single suborder, the oscines (order Passeriformes), which are thought to have become established from 35 million years onwards in association with a cooling climate28. Communities with tropical affinities are sourced by older lineages, and this overwhelms any potential effect of mixing on phylogenetic diversity.

In conclusion, by developing methods that allow for continuous variation, we confirm two major insights of Wallace1—that the world is indeed organized into discrete zoogeographic regions and that tropical biotas have a long history distinct from that of the temperate. Biological diversity is partitioned hierarchically across the globe, with shallower climatic transitions producing nested and more continuous turnover of zoogeographic regions within the major realms (Fig. 1a, b, Supplementary Figs. 4, 5). The discrete contribution of realms and their boundaries persist even when considering collections of locally interacting species across very steep climatic gradients. This organization may work through conservatism in the direct effects of temperature on bird species ranges and abundances32 or through similar conservatism in the distributions of producers, such as trees10, which in turn drive consumer coexistence28. The deep history and strong geographical restriction of biotas is consistent with explanations for tropical–temperate differences rooted in hypotheses of age, area, and climatic stability8,10. The strong linkage of local communities to regions defined by climate confirms that historical influences on community structure and function apply not just between continents but across climatic regimes as well33.

## Methods

### The Grade of Membership model

The Grade of Membership model13 is a clustering model that allows each sample to have proportional memberships in more than one cluster, where a cluster is defined by the underlying features of interest. Such models are widely recognized in population genetics as ADMIXTURE models14, where they are used to determine an individual’s ancestry from multiple populations, with each population having a distinct single-nucleotide polymorphism-level allele frequency distribution. In Natural Language Processing, these models are popularly known as topic models or Latent Dirichlet Allocation models and are used to decompose the semantic structure of text documents into one or more topics, where each topic is defined by a distinct frequency distribution of words in a vocabulary.

Here, we illustrate how the Grade of Membership model can be extended to decompose the structure of surveyed ecological communities into component building blocks of community structure. Valle et al.16 previously applied such a model to species abundance data, where they referred to the clusters as component communities. In this paper, we develop a flexible framework that can be used to cluster both taxonomic presence–absence data as well as community abundance data, thereby integrating analyses at the global (i.e. biogeographic) scale with assessments at the community level. At the global level, we assess the structure of species presences to identify patterns of bioregionalization across space. At the local level, we assess structure for various axes of biodiversity—namely species abundances, lineages (phylogenetic), and regions (geographic)—to examine how biogeographic patterns are reflected within ecological communities. We generically refer to the clusters generated by these analyses as motifs. A motif can be viewed as an analogue of ancestral populations in ADMIXTURE models or a topic in topic models.

### Species motifs

In the global context, we constructed a binary presence–absence matrix by overlapping the geographic distributions of breeding birds for each 1° × 1° global map cell meeting two conditions: (1) the cell contained at least 10% land cover and (2) the cell was overlapped by at least three species breeding distributions. The resulting matrix comprised 9518 bird species in 17,441 map cells that passed the processing steps. Polygons of species breeding distributions were obtained from BirdLife International18.

We applied a Bernoulli version of the Grade of Membership model on the presence–absence data matrix MN × G= ((mng)), where mng is 0/1 based on if the species g is absent/present in map cell n.

$$m_{ng}\sim {\mathrm{Ber}}\left( {p_{ng}} \right)$$
(1)

where png is the probability that bird species g is present in the map cell n. We assume a lower dimensional representation for png.

$$p_{ng} = \mathop {\sum }\limits_{k = 1}^K \omega _{nk}\theta _{kg}$$
(2)

where

$$0 \le \omega _{nk} \le 1\quad\quad\mathop {\sum}\limits_{k = 1}^K {\omega _{nk}} = 1\quad\quad\forall n$$
(3)
$$0 \le \theta _{kg} \le 1\quad\quad\forall k\;\forall g$$
(4)

Here, K represents the number of underlying motifs fitted in the model, ωnk represents the proportional contribution of the kth motif to map cell n, and θkg is the probability that the gth species is a member of the kth motif. We assume non-informative Dirichlet priors on the proportions vector ωn. and non-informative beta priors for each θkg.

We fit this model for different values of K ranging from 2 to 35, and models for different K were compared using Bayes factors. The membership proportions vector ωn. for each map cell n was displayed using a pie chart, placed at the exact latitude and longitude of map cell n. At a 1° × 1° resolution, this visualization shows both the spatial distribution of the motifs and, crucially, the transition between motifs across space (see Fig. 1). The θk. vector of probabilities represents the probability that a bird species is a member of species motif k and can be used to extract the bird species that differentially contribute to the different species motifs.

### Species abundance motifs

Here, the input data comprises community censuses of species abundances in 38 5 ha forest sites across the Himalaya (“Field methods” and “Data availability” described below). We observed 304 species in total and recorded their abundances in a table of counts CN × G = ((cng)) where cng is the number of individuals of species g observed in site n. Here we applied a multinomial version of the Grade of Membership model that allows each surveyed site to have contributions from multiple motifs, where each motif is defined by the proportional contribution from each species. Each row of the data matrix is modelled as follows.

$$\left( {c_{n1},c_{n2},\cdot \cdot \cdot ,c_{nG}} \right)\sim {\mathrm{Mult}}\left( {c_{n + },p_{n1},p_{n2},\cdot \cdot \cdot ,p_{nG}} \right)$$
(5)

where $$c_{n + } = \mathop {\sum}\nolimits_{g = 1}^G {c_{ng}} \;{\mathrm{and}}\;\mathop {\sum}\nolimits_{g = 1}^G {p_{ng}} = 1$$ for all n. As in case of species motif model, we assume that png has a low rank structure and can be decomposed as

$$p_{ng} = \mathop {\sum }\limits_{k = 1}^K \omega _{nk}\theta _{kg}$$
(6)

where

$$0 \le \omega _{nk} \le 1\quad\quad\mathop {\sum}\limits_{k = 1}^K {\omega _{nk}} = 1\quad\quad\forall n$$
(7)
$$0 \le \theta _{kg} \le 1\quad\quad\mathop {\sum }\limits_{g = 1}^G \theta _{kg} = 1\quad\quad\forall k$$
(8)

Here, K represents the number of motifs, ωnk represents the membership proportion of the kth motif in site n, and θkg is the relative frequency of the gth species in the kth community. We assume non-informative Dirichlet priors on the membership proportion vector ωn. for sample n and the proportional motif contribution vector θk. for the cluster k.

We fit the Grade of Membership model for different values of K from 2 to 10. For each value of k, the model was run 10,000 times with different starting points from which the fit with the highest Bayes factor was selected as the best model for that value of K. We used the maptpx package34 in R to fit the model for each K.

We displayed the membership proportions vector ωn. for each community n using a Block Structure plot, a slightly modified version of the Structure plot representation used in population genetics for visualizing admixed individuals19. In the Block Structure plot, the vectors of membership proportions are represented as horizontal stacked bar charts with samples from the eastern and western Himalaya displayed in parallel blocks and samples for each block ordered by site elevation (elevations are given in Fig. 2 and Supplementary Table 1). This aids in identifying the motif transition points with respect to elevation and comparing the motif structure between regions. The θk. vector provides the normalized abundance profiles of the different species in motif k and can be used to determine bird species that contribute most heavily to the local species abundance motifs.

In this case, species are considered as independent entities, but in reality, they may be related phylogenetically or in terms of morphological characteristics or geographic range distribution. To capture these characteristics, we consider data with the same surveyed sites along the rows but with the features along the columns placed in appropriate units for different axes of diversity.

### Phylogenetic motifs

We obtained a phylogenetic tree of species in our surveyed sites28 and cut the tree at a certain time slice, T, at which point some lineages in the tree would subtend one or more related species (Supplementary Fig. 10). We obtained a count per site for each tip present in the phylogeny at time slice T by summing over the counts of the species that tip subtends. We then fit the multinomial Grade of Membership model (see “Species abundance motifs” above) to the count data matrix with 38 sites along the rows and the common ancestors to species at time T along the columns. We considered values of T varying from the present day (the tips of the phylogenetic tree) to 20 million years before present. Finding consistent patterns for each 5 million-year increment from the present back to 20 million years before present, results presented in the main text (Fig. 3b) correspond to an analysis with T = 20 million years before present. Daru et al.17 develop similar methods for incorporating phylogenies in evaluating presence–absence data. Here, we apply this approach to community survey data and model the output with the Grade of Membership model.

### Geographical motifs

For the geographical case, we used rasters, one for each surveyed 5 ha site, to represent the geographic distributions of the species present in each community. We counted the number of species from the community that are present in each raster cell in the region represented in Supplementary Fig. 3 (longitudinal and latitudinal limits, 50°E, 120°E, 5°N, 50°N). This raster is commonly referred to as an assemblage dispersion field23, but here we focus on the dispersion field for breeding birds recorded in a small 5-ha area, rather than all birds recorded in the entire raster cell as used in other applications. Polygons of species breeding distributions were provided by BirdLife International18. After overlaying the species geographic distributions on a 360-by-560 raster (1/8th square degree cells), we obtained a count per raster cell, corresponding to the number of species with breeding polygons overlapping that cell. We subsequently vectorized the raster and stacked these vectors together to form a 38-by-201,600 matrix of counts, to which we then applied the multinomial Grade of Membership model. Note that these distribution maps are coarse grained and it has been suggested that they cannot be used at resolutions < 110 km2 (1° × 1°)35,36. However, this is not an issue in our case, where we only need to robustly capture the general features of the dispersion fields in a limited number of motifs and each species list is known from a site-specific survey.

### Modelling considerations

For the Himalayan data, we compared Grade of Membership models for different choices of K ranging from 2 to 10. As noted above, to account for the random initialization biases, for each K, we ran 10,000 iterations for each of the phylogenetic and taxonomic counts data and 100 for the geographical counts data, and we chose the model fit with the highest Bayes factor for that value of K. Because of computational constraints, we ran one iteration for each value of K for the global analysis. The results are coherent across different values of K (e.g. patterns are often nested for higher values of K), implying that the revealed structure is robust.

The Dirichlet prior assumption in the Grade of Membership model assumes that the features along the columns of the data matrix are only weakly dependent. This assumption is not true for the species or species abundance motif studies, as it ignores the phylogenetic relatedness and morphological similarity of species. The phylogenetic analysis captures this relatedness to some extent, but a more comprehensive model that accounts for all inherent relatedness would be more optimal. Also, in the geographic context, the model ignores the spatial proximity of the raster cells to one another. The models we propose thus have room for improvement, but the simplicity of the models make them computationally fast, and as is evident from Figs. 13, the approach is successful in decomposing biodiversity of the global map cells or the local Himalayan sites into biologically interpretable motifs. Because of the simplicity of the model, Bayes factors used to compare model fits should be interpreted with caution. General patterns that are consistent across different values of K are likely more reliable to interpret than patterns associated with one best fit model.

### Model comparisons

A longstanding concern in community ecology is whether the data conform to an appropriate null expectation. To address this issue, we randomly permuted the Himalayan census data according to four different null model approaches—frequency, richness, independent swap, and trial swap37,38. These permutations were generated using the R package picante39. We then fit the multinomial Grade of Membership model on the permuted data set and compared, for the same values of K, the observed and the null model generated distributions using Bayes factors. For each approach, the null model Bayes factor distribution came from fitting Grade of Membership model for a fixed number of clusters K on 1000 null model matrices. We compared the Bayes factor from fitting Grade of Membership models for same number of clusters K on the observed census data with respect to the null model Bayes factor distribution. The p values were significant with respect to 5% level of significance in all comparisons (Mann–Whitney U test, p < 0.01).

### Comparison to other clustering methods

The Grade of Membership model uses a low-dimensional factorization to cluster the samples, which calls for a comparative analysis of our approach with other clustering algorithms and dimension reduction methods. In the context of RNA-sequencing data, Dey et al.40 showed that the multinomial Grade of Membership model is more efficient in distinguishing samples from known groupings than hierarchical clustering. A possible explanation for this is that the multinomial model is able to capture sparse count data better than a non-model based hierarchical clustering approach, as exemplified by RNA-seq. Sparse count-based data are typical characteristics of species abundance data too, with our data having ~90% sparsity; hence the multinomial Grade of Membership model would seem like a natural choice over hierarchical clustering in this case.

For further evaluation, we compared the taxonomic Grade of Membership results to patterns obtained using two traditional ordination techniques—principal components analysis (PCA) and non-metric multi-dimensional scaling (NMDS). We also compared these results against patterns obtained using t-distributed stochastic neighbor embedding (t-SNE), a more recently developed machine learning method for low-dimensional data projection41 (see Supplementary Fig. 12). Since t-SNE is sensitive to the choice of the perplexity parameter42, we performed additional visualizations of the taxonomic data using t-SNE at various levels of perplexity. Results were consistently less informative. Unlike PCA, NMDS, or t-SNE, the Block Structure plot representation of the Grade of Membership model displays site membership patterns for multiple motifs in one plot and also highlights change in these motif patterns across elevation and geography much more effectively than other approaches.

### Field methods

Details on the bird surveys are in Price et al.28, who present data and describe the methods for 18 east Himalayan 5 ha sites. For this study, in order to account for geographical variation between the east and west Himalaya, T.D.P. and/or D.M. surveyed one additional site in the northeast Indian hills of Meghalaya and 19 sites in the west using similar methods (Fig. 2a). Some sites were surveyed in multiple years. For each site, we use results from a single observer from a single year, but results are not affected if we use other years or switch observers for sites which both T.D.P. and D.M. surveyed (which were the majority). We measured abundance of species belonging to 11 orders (excluding game birds and birds of prey)28. In total, we encountered 304 species out of 621 species in these orders that breed in the Himalaya28.

### Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.

## Data availability

Local community bird surveys (species abundance data) and the phylogeny of all birds included in the study are all publicly available in the R package ecostructure. Species abundances in Himalayan communities are also provided in Supplementary Data 2. Species range polygons are available upon request from BirdLife International (http://datazone.birdlife.org/species/requestdis).

## Code availability

Code for fitting Grade of Membership models, analyzing motifs, and generating visualizations is publicly available in the new R package ecostructure. The package contains: (1) functions for processing local community data using a phylogeny to fit phylogenetic motifs, (2) functions for generating presence–absence matrices and dispersion fields from GIS data sources to fit species and geographical motifs, and (3) functions for visualizing the output of those model fits. Tools for null model comparisons and comparisons of geographical motifs with climatic data are also provided. The package, and a detailed vignette of its functionality, is available for download at https://kkdey.github.io/ecostructure.

## References

1. 1.

Wallace, A. R. The Geographical Distribution of Animals (Cambridge University Press, Cambridge, 1876).

2. 2.

Holt, B. G. et al. An update of Wallace’s zoogeographic regions of the world. Science 339, 74–78 (2013).

3. 3.

Vilhena, D. A. & Antonelli, A. A network approach for identifying and delimiting biogeographical regions. Nat. Commun. 6, 1–9 (2015).

4. 4.

Daru, B. H., Elliott, T. L., Park, D. S. & Davies, T. J. Understanding the processes underpinning patterns of phylogenetic regionalization. Trens Ecol. Evol. 32, 845–860 (2017).

5. 5.

Ficetola, G. F., Mazel, F. & Thuiller, W. Global determinants of zoogeographical boundaries. Nat. Ecol. Evol. 1, 1–7 (2017).

6. 6.

Pelseneer, P. La ligne de Weber, limite zoologique de l’Asie et de l’Australie. Bull. Classe. Sci. Acad. R. Belgique 1904, 1001–1022 (1904).

7. 7.

Mayr, E. Wallace’s line in the light of recent zoogeographic studies. Q. Rev. Biol. 19, 1–14 (1944).

8. 8.

Wiens, J. J. & Donoghue, M. J. Historical biogeography, ecology and species richness. Trends Ecol. Evol. 19, 639–644 (2004).

9. 9.

Mittelbach, G. G. et al. Evolution and the latitudinal diversity gradient: speciation, extinction and biogeography. Ecol. Lett. 10, 315–331 (2007).

10. 10.

Fine, P. V. A. Ecological and evolutionary drivers of geographic variation in species diversity. Annu. Rev. Ecol. Evol. Syst. 46, 369–392 (2015).

11. 11.

Zanne, A. E. et al. Three keys to the radiation of angiosperms into freezing environments. Nature 506, 89–92 (2014).

12. 12.

Price, T. D. et al. Determinants of northerly range limits along the Himalayan bird diversity gradient. Am. Nat. 178, S97–S108 (2011).

13. 13.

Erosheva, E. A. & Fienberg, S. E. In Classification - the Ubiquitous Challenge (eds. Weihs, C. & Gaul, W.) 11–26 (Springer, Berlin, Heidelberg, 2005).

14. 14.

Pritchard, J. K., Stephens, M. & Donnelly, P. Inference of population structure using multilocus genotype data. Genetics 155, 945–959 (2000).

15. 15.

Blei, D. M., Ng, A. Y. & Jordan, M. I. Latent Dirichlet Allocation. J. Mach. Learn. Res. 3, 233–269 (2003).

16. 16.

Valle, D., Baiser, B., Woodall, C. W. & Chazdon, R. Decomposing biodiversity data using the Latent Dirichlet Allocation model, a probabilistic multivariate statistical method. Ecol. Lett. 17, 1591–1601 (2014).

17. 17.

Daru, B. H., van der Bank, M. & Davies, T. J. Unravelling the evolutionary origins of biogeographic assemblages. Divers. Distrib. 24, 313–324 (2018).

18. 18.

BirdLife International and NatureServe. Bird Species Distribution Maps of the World (BirdLife International, Cambridge, 2014).

19. 19.

Rosenberg, N. A. et al. Genetic structure of human populations. Science 298, 2381–2385 (2002).

20. 20.

Simberloff, D. & Connor, E. F. in Contemporary Quantitative Ecology and Related Ecometrics (eds. Patil, G. P. & Rosenzweig, M. L.) 123–138 (International Cooperative Publishing House, Fairland, MD, 1979).

21. 21.

Arita, H. T., Christen, J. A., Rodríguez, P. & Soberón, J. Species diversity and distribution in presence‐absence matrices: mathematical relationships and biological implications. Am. Nat. 172, 519–532 (2008).

22. 22.

Arita, H. T. Multisite and multispecies measures of overlap, co-occurrence, and co-diversity. Ecography 40, 709–718 (2017).

23. 23.

Graves, G. R. & Rahbek, C. Source pool geometry and the assembly of continental avifaunas. Proc. Natl Acad. Sci. 102, 7871–7876 (2005).

24. 24.

Carstensen, D. W., Lessard, J.-P., Holt, B. G., Borregaard, M. K. & Rahbek, C. Introducing the biogeographic species pool. Ecography 36, 1310–1318 (2013).

25. 25.

Pavoine, S. & Ricotta, C. Functional and phylogenetic similarity among communities. Methods Ecol. Evol. 5, 666–675 (2014).

26. 26.

White, A. E. Geographical barriers and dispersal propensity interact to limit range expansions of Himalayan birds. Am. Nat. 188, 99–112 (2016).

27. 27.

Ricklefs, R. E. Evolutionary diversification and the origin of the diversity–environment relationship. Ecology 87, S3–S13 (2006).

28. 28.

Price, T. D. et al. Niche filling slows the diversification of Himalayan songbirds. Nature 509, 222–225 (2014).

29. 29.

Verity, R. & Nichols, R. A. Estimating the number of subpopulations (K) in structured populations. Genetics 203, 1827–1839 (2016).

30. 30.

Bradburd, G. S., Coop, G. M. & Ralph, P. L. Inferring continuous and discrete population genetic structure across space. Genetics 210, 33–52 (2018).

31. 31.

Ricklefs, R. E. Disintegration of the ecological community. Am. Nat. 172, 741–750 (2008).

32. 32.

Elsen, P. R., Tingley, M. W., Kalyanaraman, R., Ramesh, K. & Wilcove, D. S. The role of competition, ecotones, and temperature in the elevational distribution of Himalayan birds. Ecology 98, 337–348 (2017).

33. 33.

Cavender-Bares, J., Ackerly, D. D., Hobbie, S. E. & Townsend, P. A. Evolutionary legacy effects on ecosystems: biogeographic origins, plant traits, and implications for management in the era of global change. Annu. Rev. Ecol. Evol. Syst. 47, 433–462 (2016).

34. 34.

Taddy, M. A. On estimation and selection for topic models. PMLR 22, 1184–1193 (2012).

35. 35.

Hurlbert, A. H. & Jetz, W. Species richness, hotspots, and the scale dependence of range maps in ecology and conservation. Proc. Natl Acad. Sci. 104, 13384–13389 (2007).

36. 36.

Pollock, L. J., Thuiller, W. & Jetz, W. Large conservation gains possible for global biodiversity facets. Nature 546, 141–144 (2017).

37. 37.

Gotelli, N. J. Null model analysis of species co-occurrence patterns. Ecology 81, 2606–2621 (2000).

38. 38.

Miklós, I. & Podani, J. Randomization of presence-absence matrices: comments and new algorithms. Ecology 85, 86–92 (2004).

39. 39.

Kembel, S. W. et al. Picante: R tools for integrating phylogenies and ecology. Bioinformatics 26, 1463–1464 (2010).

40. 40.

Dey, K. K., Hsiao, C. J. & Stephens, M. Visualizing the structure of RNA-seq expression data using grade of membership models. PLoS Genet. 13, e1006599–23 (2017).

41. 41.

van der Maaten, L. & Hinton, G. Visualizing data using t-SNE. J. Mach. Learn. Res. 9, 2579–2605 (2008).

42. 42.

Wattenberg, M., Viégas, F. & Johnson, I. How to use t-SNE effectively. Distill https://doi.org/10.23915/distill.00002 (2016).

43. 43.

Hijmans, R. J., Cameron, S. E., Parra, J. L., Jones, P. G. & Jarvis, A. Very high resolution interpolated climate surfaces for global land areas. Int. J. Climatol. 25, 1965–1978 (2005).

## Acknowledgements

We thank the Chief Wildlife Wardens of the six Indian Himalayan states for permission to collect the data; VB Mathur and Pratap Singh for their continuing support; and I. Quintero, D. Schluter, and M. Steinrücken for critical comments on the manuscript. Fieldwork was supported by the NSF and the National Geographic Society. Part of this work was developed while A.E.W. was a visiting NSF GROW Fellow at the Center for Macroecology, Evolution and Climate at the University of Copenhagen, hosted by C. Rahbek and S. Keith and funded by the Danish National Research Foundation and the NSF. A.E.W. was supported by the NSF GRFP (nos. DGE-1144082 and DGE-1746045) and a GAANN Quantitative Ecology Fellowship (no. P200A150101). Analytical work was supported by NIH grant no. HG002585 to M.S.

## Author information

Authors

### Contributions

A.E.W., K.K.D. and T.D.P. designed the study. A.E.W., K.K.D. and M.S. performed the analyses. T.D.P. and D.M. collected the census data. A.E.W., K.K.D. and T.D.P. wrote the paper, with input from all authors.

### Corresponding author

Correspondence to Alexander E. White.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

Journal peer review information: Nature Communications thanks Barnabas Daru, Alex Pigot, and other anonymous reviewer(s) for their contribution to the peer review of this work.

Publisher’s note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

White, A.E., Dey, K.K., Mohan, D. et al. Regional influences on community structure across the tropical-temperate divide. Nat Commun 10, 2646 (2019). https://doi.org/10.1038/s41467-019-10253-6

• Accepted:

• Published:

format: plain


text:
## Found 25 Documents (Results 1–25)

100
MathJax

### Some degenerate mean convergence theorems for Banach space valued random elements. (English)Zbl 07531403

MSC:  60F25 60B11 60B12
Full Text:

Full Text:

### A complete convergence theorem for row sums from arrays of rowwise independent random elements in Rademacher type $$p$$ Banach spaces. II. (English)Zbl 1469.60092

MSC:  60F15 60B12 60B11
Full Text:

Full Text:

### Complete convergence theorems for weighted row sums from arrays of random elements in Rademacher type $$p$$ and martingale type $$p$$ Banach spaces. (English)Zbl 1423.60057

Stochastic Anal. Appl. 37, No. 6, 1092-1106 (2019); correction ibid. 40, No. 4, 764 (2022).
MSC:  60F15 60B12 60B11
Full Text:

Full Text:

Full Text:

### A complete convergence theorem for row sums from arrays of rowwise independent random elements in Rademacher type $$p$$ Banach spaces. (English)Zbl 1237.60022

MSC:  60F15 60B12 60B11
Full Text:

### Some complete convergence results for row sums from arrays of rowwise independent random elements in Rademacher type $$p$$ Banach spaces. (English)Zbl 1256.60013

MSC:  60F15 46N30 60B10
Full Text:

### Almost sure convergence for double arrays of block-wise $$M$$-dependent random elements in Banach spaces. (English)Zbl 1246.60047

MSC:  60F15 60B11 60B12
Full Text:

Full Text:

### On the weak law with random indices for arrays of Banach space valued random elements. (English)Zbl 1192.60015

MSC:  60B12 60B11

Full Text:

Full Text:

### Strong and weak laws of large numbers for double sums of independent random elements in Rademacher type $$p$$ Banach spaces. (English)Zbl 1112.60002

MSC:  60B12 60F15 60F05
Full Text:

MSC:  60B12
Full Text:

### On the rate of complete convergence for weighted sums of arrays of Banach space valued random elements. (English)Zbl 1035.60004

Theory Probab. Appl. 47, No. 3, 455-468 (2002) and Teor. Veroyatn. Primen. 47, No. 3, 533-547 (2002).
Full Text:

Full Text:

### A note on complete convergence for partial sums of B-valued rowwise independent random elements. (Chinese. English summary)Zbl 1018.60004

MSC:  60B12 46B09

MSC:  60B12

MSC:  60B12
Full Text:

### On strong laws of large numbers for arrays of rowwise independent random elements. (English)Zbl 0844.60005

MSC:  60B12 62G05 60F15
Full Text:

### Stochastic convergence of randomly weighted sums of random elements. (English)Zbl 0553.60009

Reviewer: S.D.Chatterji
MSC:  60B12
Full Text:

all top 5


text:
# zbMATH — the first resource for mathematics

##### Examples
 Geometry Search for the term Geometry in any field. Queries are case-independent. Funct* Wildcard queries are specified by * (e.g. functions, functorial, etc.). Otherwise the search is exact. "Topological group" Phrases (multi-words) should be set in "straight quotation marks". au: Bourbaki & ti: Algebra Search for author and title. The and-operator & is default and can be omitted. Chebyshev | Tschebyscheff The or-operator | allows to search for Chebyshev or Tschebyscheff. "Quasi* map*" py: 1989 The resulting documents have publication year 1989. so: Eur* J* Mat* Soc* cc: 14 Search for publications in a particular source with a Mathematics Subject Classification code (cc) in 14. "Partial diff* eq*" ! elliptic The not-operator ! eliminates all results containing the word elliptic. dt: b & au: Hilbert The document type is set to books; alternatively: j for journal articles, a for book articles. py: 2000-2015 cc: (94A | 11T) Number ranges are accepted. Terms can be grouped within (parentheses). la: chinese Find documents in a given language. ISO 639-1 language codes can also be used.

##### Operators
 a & b logic and a | b logic or !ab logic not abc* right wildcard "ab c" phrase (ab c) parentheses
##### Fields
 any anywhere an internal document identifier au author, editor ai internal author identifier ti title la language so source ab review, abstract py publication year rv reviewer cc MSC code ut uncontrolled term dt document type (j: journal article; b: book; a: book article)
Periodic and subharmonic solutions for superquadratic discrete Hamiltonian systems. (English) Zbl 1053.39011
Some results are obtained for the existence and subharmonic solutions to discrete Hamiltonian systems \aligned\Delta x_1(n) &= -H_{x_2}(n, x_1(n+1), x_2(n)),\\ \Delta x_2(u) &= H_{x_1}(n, x_1(n+1), x_2(n))\endaligned\tag1 by using critical point theory, where $x_1,x_2\in \bbfR^d$, $H\in C^1(\bbfR\times \bbfR^d\times \bbfR^d,\bbfR)$, $\Delta x_i(n)= x_i(n+ 1)- x_i(n)$, $i= 1,2$. Denote $z= (x^T_1, x^T_2)^T$, $H(t, z)= H(t, x_1,x_2)$ and assume the following conditions $(\text{H}_1)$ $H(t, z)\in C^1(\bbfR\times \bbfR^{2d},\bbfR)$ and there exists a positive integer $m$ such that $\forall(x,z)\in \bbfR\times \bbfR^{2d}$, $H(t+ m,z)= H(t,z)$, $(\text{H}_2)$ For any $(t, z)\in \bbfR\times\bbfR^{2d}$, $H(t,z)\ge 0$ and $H(t,z)= o(\vert z\vert^{2d})$ (as $z\to 0$); $(\text{H}_3)$ There exist some constants $R> 0$, $\beta> 2$ such that for any $\vert z\vert\ge R$, $(z,H^1_z(t,z))\ge\beta H(t,z)> 0$; $(\text{H}_4)$ $H(t,z)$ is even for the second variable $z$, namely, $H(t,-z) =H(t, z)$, $\forall (t, z)\in\bbfR\times\bbfR^{2d}$. By assumptions $(\text{H}_1)$ and $(\text{H}_3)$ the authors see that $H(t,z)\ge a_1\vert z\vert^\beta- a_2$, $\forall(t,z)\in \bbfR\times \bbfR^{2d}$. So assumptions $(\text{H}_1)$--$(\text{H}_3)$ imply that $H(t, z)$ grows superquadratically both at zero and at infinity. The main results of this paper are the following two theorems: Theorem 1: Under assumption $(\text{H}_1)$--$(\text{H}_4)$ for any given positive integer $p$, there exist at least $d(pm -1)$ geometrically distance nontrivial periodic solutions of the system (1) with period $pm$. Without assumption $(\text{H}_4)$, they have Theorem (2): Under assumptions $(\text{H}_1)$--$(\text{H}_3)$, for any given positive integer $p$, there exist at least two nontrivial periodic solutions of (1) with period $pm$.

##### MSC:
 39A11 Stability of difference equations (MSC2000) 58E50 Applications of variational methods in infinite-dimensional spaces
Full Text:
##### References:
 [1] Ahlbrandt, C. D.: Equivalence of discrete Euler equations and discrete Hamiltonian systems. J. math. Anal. appl. 180, 498-517 (1993) · Zbl 0802.39005 [2] Bohner, M.: Linear Hamiltonian difference systemsdisconjugacy and Jacobi-type conditions. J. math. Anal. appl. 199, 804-826 (1996) · Zbl 0855.39018 [3] Chang, K. C.: Critical point theory and its applications. (1980) [4] Chang, K. C.: Infinite dimensional Morse theory and multiple solution problems. (1993) · Zbl 0779.58005 [5] Chen, S.: Disconjugacy, disfocality, and oscillation of second order difference equations. J. differential equations 107, 383-394 (1994) · Zbl 0791.39001 [6] Elaydi, S. N.; Zhang, S.: Stability and periodity of difference equations with finite delay. Funkcialaj ekvac. 37, 401-413 (1994) · Zbl 0819.39006 [7] Erbe, L. H.; Yan, P.: Disconjugacy for linear Hamiltonian difference systems. J. math. Anal. appl. 167, 355-367 (1992) · Zbl 0762.39003 [8] Guo, Z.; Yu, J.: The existence of periodic and subharmonic solutions for second-order superlinear difference equations. Sci. China, ser. A 46, 506-515 (2003) · Zbl 1215.39001 [9] Hartman, P.: Difference equationsdisconjugacy, principal solutions, Green’s functions, complete monotonicity. Trans. amer. Math. soc. 246, 1-30 (1978) · Zbl 0409.39001 [10] Long, Y. M.: The index theory of Hamiltonian system and its applications. (1993) [11] Mawhin, J.; Willem, M.: Critical point theory and Hamiltonian systems. (1989) · Zbl 0676.58017 [12] Rabinowitz, P. H.: Periodic solutions of Hamiltonian systems. Comm. pure appl. Math. 31, 157-184 (1978) · Zbl 0358.70014 [13] Rabinowitz, P. H.: On subharmonics solutions of Hamiltonian systems. Comm. pure appl. Math. 33, 609-633 (1980) · Zbl 0425.34024 [14] P.H. Rabinowitz, Minimax Methods in Critical Point Theory with Applications to Differential Equations, CBMS. Vol. 65, Amemrican Mathematical Society, Providence, RI, 1986. · Zbl 0609.58002


text:
# Jupyter Notebook

These relatively brief notes contain an overview of the Jupyter Notebook environment, and include the content that was coded live in class on Wednesday, 1/24. Because much of the tutorial regarding the notebook is not well suited to static presentation on web pages, it is recommended that you watch the video lecture and follow along in the notebook, rather than solely rely on these notes. In addition, unlike the majority of the notes for this class (which are written in Jupyter Notebook, but then exported to Markdown for presentation on the class website), I am going to leave these notes in Jupyter notebook form, to emphasize the fact that you can download and step through the examples here.

## Overview of Jupyter Notebook

Jupyter Notebook is a browser-based coding environment, used extensively for prototyping and interactive development in data science applications. Jupyter Notebook is an evolution of an older project called the IPython Noteboook (this is the origin of the notebook file extension “.ipynb”), and while (as the name suggests) Jupyter Notebook supports languages other than Python, at the current time Python is by far the most common language for these notebook. General information about Jupyter Notebook and related projects can be found at the Jupyter project page.

The central unit within a Jupyter Notebook are “cells”. These cells can be either contain code or Markdown (a simple formatting language, which can also include things like LaTeX equations). The dropdown menu at the top of the screen indicates the type of the current cell.

Code cells can be executed by pressing the ▶❚ button at the top of the notebook, or more commonly via the commands Shift-Enter (execute and move to the next cell) or Control-Enter (execute and stay on that cell). All Python code is executed in a single running Python environment, called the “Kernel” in Jupyter notebook. Variables are shared across all cells, and the code is executed in the order in which the cells are run (not necessarily sequential in the notebook), which can get your notebook into rather confusing states if you don’t always execute cells in order.

Let’s look at a a few examples.

1+2

a = 1.0
b = 2.0

print(a)
b

for i in range(10):
print(i)

0
1
2
3
4
5
6
7
8
9

Any print statements will print to the output section for the cell, and the output will also contain the string representation of the object returned by the last line in the cell. Thus, in the above setting where the variable b appears on the last line of the cell, its content is printed at the end of the cell output, following any previous print statements that happen before.

Any Python code will be valid in these cells, so we can import external libraries, defines classes, and functions, etc.

import requests

def square(x):
"""Square the input x"""
return x*x

square(4)

### Efficient navigation in the notebook

Because you’ll be spending a lot of timing writing code in the notebook, it helps to become at least a little bit familiar with the features of the editor. While the notebook in many ways makes a poor actual code editing environment (compared to more fully featured editors ranging from Sublime, vi, Emacs, Atom, etc), it’s not that bad if you familiarize yourself with some of the keyboard shortcuts.

You can look up all the keyboard shortcuts (in addition to adding your own) in the “Help -> Keyboard Shortcuts” menu, but some of the more common ones I use are the following. First, though, it is important to distinguish between the “edit mode” (when directly editing a cell) and “command mode” (navigating over cells). You can switch between these using “ESC” or “Ctrl-M” (switch to command mode) and “Enter” (switch to edit more).

Common keyboard shortcuts in command mode:

• “x”: delete a cell (though be careful, because you can only undo the deletion of one cell)
• “a”: insert new cell above
• “b”: insert new cell below
• “m”: convert cell to Markdown
• “y”: convert cell to code
• Up/down: navigate up and down over cells
• Shift-Enter, Ctrl-Enter: execute cell (also works in edit mode)

Common shortcuts in edit mode:

• Ctrl-up/Ctrl-down: move to start/end of cell
• Tab: indent selected area (when text is selected) or autocomplete (when editing in the middle of a line)
• Shift-Tab: unindent selected area (when text is selected), get function help (when following a function name)
• Command-/: toggle comment/uncommand selected region

The best way to familiarize yourself with these commands is to try to use the notebook entirely without using the mouse. In practice, you’ll often rely on the mouse for some things (for instance, I prefer to have commands like restarting the kernel require a mouse click), but trying to avoid it for some time will get you familiar enough with the common commands to be fairly productive in the Notebook editing environment.

### Getting help

This was touched upon in the previous list of commands, but is important enough to warrant further discussion. One of the nicer elements of the notebook editor is it’s built-in support for code autocompletion and function lookup. After writing some portion of code, you can press the “tab” key to autocomplete: if there is only one viable completion of the word you are currently typing, it will simply complete the word. If there are multiple viable predictions, then it will open a popup menu where you can view all possible completions. The later is useful for quickly browsing through all functions or variables in a library/object.

The second useful command is the inline help popup. After typing a function name, you can get help for that function by pressing “Shift-Tab”. This will bring up a popup with a brief description of the function. If you want additional help, it may be available for some functions by clicking the ⌃ button in the top right of the help popup.

### Cell magics

In addition to running Python code, the Jupyter Notebook has some built-in routines for performing operations outside of Python, timing or analyzing code runs, etc. These “cell magics” are prefaced by % (at the beginning of a line … this is technically called a “line magic”, but I usually see both cases referred to as cell magics) for single-line magics and %% at the beginning of a cell for whole-cell magics. We won’t cover very many of these, but some are very useful and so you should be familiar with the basics. A much more exhaustive list of cell magics is here: Built-in cell magics.

• Time operations with %timeit (for single line), %%timeit (for the whole cell). This command will run the line or cell multiple times and provide average timing. It is adaptive, so that operations that take less time are run more often, so as to provide a better estimate of the run time (thus, the time it takes to run run this command is not indicative of the actual time it takes to run the code. If you want to just time a single pass, using %time or %%time.
%time sum(x**2 for x in range(10000))

• Execute bash commands with %%bash. Use this very sparingly, as it effectively executes shell commands outside the actual notebook environment, and makes the notebook potentially platform-dependent.
%%bash
ls

jupyter.ipynb
shakespeare.txt

• Profile a function line-by-line with line profiler (may require that you install the necessary pip packages depending on whether it’s included in your distribution or not). Note that we need to call the additional magic command %load_ext to load this extension.
%load_ext line_profiler

def function_to_profile():
print(sum(x**2 for x in range(1000)))
print(sum(x**3 for x in range(10000)))

%lprun -f function_to_profile function_to_profile()

332833500
2499500025000000

## Python-specific features for Practical Data Science

In the remainder of this notebook (which as you go through it, should serve both as an illustration of some concepts in the Notebook, and a brief highlight of some of the relevant Python concepts we’ll use frequently throughout this course. Importantly, these notes are not meant to be a general tutorial on Python, which you are already expected to be familiar with. If any of the basic Python concepts here seem difficult, we recommend you consult a standard Python Tutorial.

The most common “built in” data types you will interact with when doing data science work at lists and dictionaries (there are of course additional types like Numpy Arrays, Pandas Dataframes, and others, but these are provided by external libraries). It’s good to have a brief understanding of how to use these data structures effectively.

### Lists

Lists are denoted by items within square brackets.

list1 = ["a", "b", "c", "d"]
list2 = [1, 2, 3, "4", [1,2]]

Items within a list can be accessed via several types of indexing: indexing to a given element, negative indexing (backward from the end of a list), and slice-based indexing that returns subsets of the list.

print(list1[0])
print(list1[-1])
print(list1[1:2])
print(list1[0:4:2])
for a in list1:
print(a)

a
d
['b']
['a', 'c']
a
b
c
d

### List comprehensions

One slightly less well-known construct that I use extremely frequently (so it may come up in both sample code and homework code), is the list comprehension. Briefly, this a method for constructing a list by iterating over another list. Let’s suppose we wanted to create a list3 object that included every element from list1, but with an underscore after each string. We could do it by explicitly constructing the list and adding each element, like so.

list3 = []
for x in list1:
list3.append(x + "_")
list3

However, this quickly gets verbose, if we want to create several new lists this way. We could get this same result through a list comprehension, which has the syntax [some_expression(item) for item in list], and returns a new list by applying some_expression (not necessarily an actual function, just some expression that involves item) to each element of the list.

list3 = [x + "_" for x in list1]
list3

As a slightly more complex example, let’s use list comprehensions to count the number of words in a file. The “shakespeare.txt” file included with this notebook contains test for all the collected works of Shakespeare. Let’s first read all the lines of Shakespeare into a file.

with open("shakespeare.txt") as f:

Now let’s use a list comprehension to count the number of words in each line (given by len(line.split()), which splits the line by the space character), and then compute the sum of this whole list.

sum([len(line.split(" ")) for line in lines])

As a final node, if our only goal is to sum up the total number of words (rather than explicitly create the list containing the number of words in each line), we can omit the brackets from the call above, which creates what is called a generator expression. This is like a list comprehension except that it doesn’t actually instantiate the new list: it simply generates each element one at a time and (in this case) passes each to the sum() function.

sum(len(line.split(" ")) for line in lines)

### List implmentation internals

As a final note about lists, it is important for creating efficient Python code to understand a little bit about the nature of how lists are implemented internally. Python lists are not really “lists” in the typical CS sense of the word, i.e., they are not linked lists or some structure like this. Instead, a Python list is really a dynamically sized array. That is, a list is an array of fixed-size elements (more precisely, it is an array of abstract “Python Object” elements, which in turn point to numbers, strings, other arrays, etc, while having the actual array elements in the list be fixed size). The arrays are pre-allocated to have a certain amount of “extra elements” that can be used to add new items to the list; if we want to append a new item to the list, and do not have enough room in the underlying array, it is resized with some additional buffer (for example, the underlying size could be doubled … though in reality Python uses a slightly more involved growth algorithm than just doubling each time) to allow for the additional elements. Because this resizing happens relatively infrequently, it does not cost much from a computational perspective. Put in big O notation, the following operations are lists are all constant time:

• Append: O(1) (average case)
• Lookup: O(1)
• Delete last element: O(1)

On the other hand, if you attempt to insert a new element somewhere in the middle of the list (shifting down later element), or delete an item in the middle of the list (shifting up later elements), these operations are expensive, because we need to copy every single item in the list after the inserted or deleted item, and move it in memory. In big O notation, the following operations take linear time:

• Insert element at arbitrary position: O(n)
• Delete element at arbitrary position: O(n)

As an illustration of this, let’s consider two versions of code that creates an array, either by appending or inserting (at the beginning of the list) new elements:

%%timeit
all_words = []
for line in lines[:10000]:
for word in line.split():
all_words.insert(0, word)

816 ms ± 2.04 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

%%timeit
all_words = []
for line in lines[:10000]:
for word in line.split():
all_words.append(word)

7.09 ms ± 27 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

The second version is about 100x faster than the first. This type of speed difference can be crucial when you write data processing loops.

A good page with further explanation about the internals of Python lists here (more technical than you need for this class certainly, but for those who are curious): Python list implementation.

### Dictionaries

The next main built in data type you’ll use in data science is the dictionary. Dictionaries are mappings from keys to values, where keys can be any “immutable” Python type (most commonly strings, numbers, booleans, tuples … but importantly not lists or other dictionaries), and values can be any python type (including lists or dictionaries).

Dictionaries can be created with curly brackets, like the following:

dict1 = {"a":1, "b":2, "c":3}

And then elements are accessed by square brackets.

dict1["a"]

Unlike lists, dictionaries can’t be indexed by slices, or negative indexing, or anything like that. The keys in a dictionary are treated as unordered, so there is no notion to sequence in the items of a dictionary. We can use the same notation to assign new elements to the dictionary.

dict1["d"] = 4

Note that we can make this call even though dict["d"] previously did not contain anything (and if we try to just execute this statement, it will throw an exception). You can also check for a key belonging to a dictionary with the command:

"a" in dict1

Finally, there is the analogue to list comprehensions: dictionary comprehensions. These are specified similar to a list comprehension, but are denoted by the syntax {key(item) : value(item) for item in list}.

{i:i**2 for i in range(10)}

### Dictionary internals

Internally, dictionaries are represented using hash tables. That is, the dictionary elements are all contained in a relatively small array. When inserting a new element in the dictionary, we compute a hash of the key, and modulo this number by the size of the array. If that location in the underlying array is empty, we store the key/value pair at that index. The the location is already with note different element (which has to be possible, since there are more possible keys than the size of the underlying array) we execute what is called a “probing strategy” to find the next free slot. The details of the hashing function and probing strategy aren’t important (some info is on the page linked below), but the key portions are that the process is deterministic, so we can easily both assign elements and look up elements by key (similarly computing the hash and probing until the key at the location matches the key we are looking for … note that this is why we need to store both the key and value in the array).

A good hash function will tend to generate “random” locations in the array, so there is a high probably we will find an empty slot without too many probing iterations. In Python, once the array is 2/3 full, we double (or quadruple, for small-sized dictionaries) the size of the underlying array, and rebuild the hash table (which is required, since the location of different key/values pairs now changes for a different size of underlying array). Just like with a list, although this rebuilding operation is slow, because it happens relatively infrequently, it does not end up costing too much time. In big O notation, the operations of a dictionary all have (average case) constant time:

• Insert new element: O(1)
• Lookup element: O(1)
• Delete element: O(1)

### Classes

Although this section will not describe it in any detail, it will also be necessary to be familiar with classes in Python. We will just mention a few notes about classes here, using this example:

class MyClass:
def __init__(self, n):
self.n = n

def get_n(self):
return self.n

a = MyClass(1)
a.get_n()

The first note is that all functions within a Python class take an instance of that class as the first argument, usually named self in implementations (but it can be named anything). Class methods and static methods (see the discussion in the list below) behave differently, but we won’t be using those features much in this class. The second thing of some importance is that unlike other object-oriented languages, Python does not actually have a distinction between “public” and “private” variables. Although here it seems like the “n” variable should be private (inaccessible outside the class), and only accessible via the method get_n(), we can just as easily access it directly.

a.n

This means that Python doesn’t really respect the traditional object-oriented abstractions (they are more just rules of thumb, that can be overridden by any code that wants to). Be careful of this fact if you’re used to classes in more structured languages like C++ or Java.

## Visualizations in notebook (preview)

While we are going to have an entire lecture on visualization, much of which will come with examples on how to generate visualizations in the notebook, I want to give a quick preview here of how we can generate figures inline in the notebook. The “magic” commands here are the following, first to import a relevant plotting library, then a cell magic command that instructs Jupyter to plot figures in the notebook.

import matplotlib.pyplot as plt
%matplotlib notebook

Now let’s plot a simple sine wave (using numpy, which we’ll also cover more later, but hopefully this notation is clear).

import numpy as np
x = np.linspace(0,2*np.pi,100)
plt.plot(x, np.sin(x))

This should open an interactive plot, where you can scroll around the image, zoom in, return to the “home” position, and even save the file. Only one interactive plot can be active in a notebook at a time. You can also generate “static” inline images by replacing the %matplotlib notebook magic with %matplotlib inline.

%matplotlib inline

plt.plot(x, np.sin(x))


text:
# How to create a list of figures

My problem is not exactly creating the list, but I create it according to the norms of my country. The list should look like this

Figure 1 - Caption (white space or dotted) 6

It should start with the word figure followed by its numbering, then a dash, then its caption and in the right corner of the page the number of the page where it appears.

There is a class called abntex2 that does this, but I could not make it work using the book class. Some commands contained in the abntex2 class that are related to the list of figures are

\renewcommand{\cftfigurename}{\figurename\space}
\renewcommand*{\cftfigureaftersnum}{\hfill\textendash\hfill}

Add un minimal code (need any figure called 1)

\documentclass{book}
\usepackage{hyperref}
\usepackage{graphicx}
\renewcommand{\cftfigurename}{\figurename\space}
\renewcommand*{\cftfigureaftersnum}{\hfill\textendash\hfill}

\begin{document}

\pdfbookmark[0]{\listfigurename}{lof}%need \usepackage{hyperref}
\listoffigures*
\cleardoublepage

\begin{figure}
\includegraphics[width=\linewidth]{1}
\caption{Test}
\end{figure}

\end{document}

• What class are you using currently (or want to use)? – Werner Feb 14 '18 at 17:22
• As a Brazilian, I am shame because of this absurd rules in abnt. – Sigur Feb 14 '18 at 17:25
• These are commands from tocloft. Try loading it and add these commands to your preamble. Do you want page number to be right after captions or at the end of lines, with one figure per line? – Bernard Feb 14 '18 at 17:25
• I don't see what's so absurd. Each country has its own typographical rules. – Bernard Feb 14 '18 at 17:27
• @Bernard, just my opinion. But when we read all the rules, we start to be crazy. Specially to format the text in TeX. – Sigur Feb 14 '18 at 17:29

Here is a way. I supposed you won't have more than 99 figures (one has to compute the width of the label in the list of figures). I also added the emptypage package, to have no header/footer on empty pages.

Also, as mentioned by @ChristianHupfer, the hand-made \pdfbookmark[0]{…} can be replaced with loading package tocbibind with option [notoc] so that the table of contents does not refer to itself.

\documentclass{book}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{graphicx}
\usepackage{calc}
\usepackage{tocloft}
\usepackage[nottoc]{tocbibind}
\usepackage{emptypage}
\usepackage{hyperref}

\renewcommand*{\cftfigname}{\figurename\space}
\renewcommand*{\cftfigaftersnum}{~\textendash\hfill}
\renewcommand{\cftfigpresnum}{\cftfigname}
\setlength{\cftfigindent}{0pt}
\setlength{\cftfignumwidth}{\widthof{\cftfigname 00~\textendash~}}

\begin{document}

\pagestyle{plain}

\tableofcontents
\listoffigures
\cleardoublepage
\setcounter{figure}{49}

\chapter{Some Chapter}

\begin{figure}
\includegraphics[width=\linewidth]{example-image}
\caption{Test}
\end{figure}

\end{document}

• You beat me by a few seconds. You could use \usepackage[nottoc]{tocbibind} to get rid of that weird manual \pdfbookmark stuff. – user31729 Feb 14 '18 at 19:46
• Done, mylord ! – with due credits. That is a really useful comment, as I hadn't tested what happens in the table of contents. – Bernard Feb 14 '18 at 20:18
• I can't upvote twice, however ;-) – user31729 Feb 14 '18 at 21:37
• @Bernard Thank you very much. I was able to make the list of tables using the same commands, I just substituted fig by tab. – Marcelo Rodrigues Feb 16 '18 at 13:21
• @ChristianHupfer: Sorry. One of my many typos – unless it was a lapsus calami: perhaps it subconsciously stood for ὑπέρ ;o) – Bernard Mar 1 '18 at 21:14


text:
Infinite-dimensional hex

Suppose $n$ players take turns selecting vertices of the grid $[k]^n = \left\{0, 1, 2, \ldots, k-1\right\}^n$. Each player is assigned a pair of opposite faces of the grid, and wins the game if they connect their assigned faces by a path (potentially using diagonal moves). Once a vertex is chosen, it cannot be chosen by any other player, and the game ends once every vertex has been chosen.

This game must always be won by at least one player. David Gale gives a simple proof here. If we restrict the notion of "adjacent" we can obtain a game more like Hex, which we can prove has a unique winner using a slick induction on $k$.

But what happens if we take $n = \omega$?

More formally, suppose we partition $[k]^\omega$ into $A_1, A_2, \ldots$. We say that two points $x,y$ are adjacent if $|x(i) - y(i)| \leq 1$ for each $i$. Does there necessarily exist an $i$ and a path $x_1, x_2, \ldots, x_n \in A_i$ such that $x_m$ is adjacent to $x_{m+1}$ for each $m$, $x_1(i) = 0$, and $x_n(i) = k-1$?

One reason to think this might hold up in the infinite-dimensional case is that it works when $k = 2$, which suggests that the infinite dimension isn't fundamentally a deal-breaker. If $k = 2$, then every pair of points is adjacent, so in order for us to fail each $A_i$ must either be a subset of $\left\{x : x(i) = 0\right\}$ or $\left\{x : x(i) = 1\right\}$. Without loss of generality we can assume the former. But then the constant function $x(i) := 1$ is not in any of the $A_i$.

Edit: the case $k = 3$ also works, although I found it a lot harder. (I doubt this proof is the best one. It is strikingly different in character from more typical fixed point arguments, which seems related to the fact that it produces paths of length exactly $3$. I doubt the idea will generalize, though I think this still provides more evidence that the claim is true.)

A partial assignment is an $a \in \left([k] \cup \left\{ *\right\}\right)^{\omega}$, and we say that $x$ satisfies $a$ if $\forall i : a(i) \in \left\{*, x(i)\right\}$. The partial assignments form a poset in the natural way ($a > a'$ iff satisfying $a'$ is easier than satisfying $a'$).

Say that a partial assignment is good if it never takes on the value $1$, and if whenever coordinate $i$ is unequal to $*$, there are no points satisfying the assignment which receive label $i$. It is easy to check that the intersection of any chain of good partial assignments is itself good, so there is some maximal good assignment $a$.

Define $x$ by $x(i) = 1$ if $a(i) = *$, $x(i) = a(i)$ otherwise. Let $i$ be the label of $x$. Because $a$ was good, coordinate $i$ cannot be set in $a$. Because $a$ was maximal, setting coordinate $i$ to $0$ must yield a bad assignment. This means that some point consistent with $a$ which has label $i$ and which has $i^{\text{th}}$ coordinate $0$. Similarly, there is some point consistent with $a$ which has label $i$ and which has $i^{\text{th}}$ coordinate $2$. But together with $x$, these three points form a path which has all of the desired properties.

-
In the infinite-dimensional case, as described here, the games are still countable, and they do not correspond do the partitions of the infinite-dimensional cube. – Włodzimierz Holsztyński Oct 27 '13 at 6:30
Yes, if the players alternate turns, then everyone only plays once. Calling it a "game" is a bit of a stretch. – Paul Christiano Oct 27 '13 at 18:15

It seems the claim is false, though I don't have a good sense for what the actual counterexample looks like. With luck, I've made an error somewhere.

Consider the normed space $\ell^{\infty}$. One can show that there is a Lipschitz retraction from the unit ball $[-1, 1]^{\omega}$ to the unit sphere.

Let $f$ be this retraction, let $k$ be some integer much greater than the Lipschitz constant of $f$, and consider my claim for $[k]^{\omega}$. We'll define an outcome of the game as follows:

For a point $x \in [k]^{\omega}$, consider the point $b(x) = \frac {2x}{k} - 1$ in the unit ball. By definition $f(b(x))$ has some coordinate in the interval $[-1, 1/k-1] \cup [1-1/k, 1]$. Let $i$ be one such coordinate, and assign the point $x$ the color $i$. I claim the resulting grid has no winning player.

Suppose for a contradiction that player $i$ won. That implies there is some sequence of adjacent points $x_1, x_2, \ldots, x_m$ all of color $i$ for which the $i^{\text{th}}$ coordinate goes from $0$ to $k-1$. The $i^{\text{th}}$ coordinate of $x_1$ is $0$, so the $i^{\text{th}}$ coordinate of $b(x_1)$ is $-1$ and hence the $i^{\text{th}}$ coordinate of $f(b(x_1))$ is also $-1$. Similarly, the $i^{\text{th}}$ coordinate of $f(b(x_m))$ is $1$. But since each $x_j$ is assigned color $i$, the $i^{\text{th}}$ coordinate of each $f(b(x_j))$ is in $[-1, 1/k-1] \cup [1 - 1/k, 1]$.

So there must be some $j$ such that $f(b(x_j)) \in [-1, 1/k-1]$ and $f(b(x_{j+1})) \in [1/k-1, 1]$. But since $x_j$ and $x_{j+1}$ are adjacent, $||b(x_j) - b(x_{j+1})||_{\infty} < 2/k$. Since $||f(b(x_j)) - f(b(x_{j+1}))||_{\infty} > 1 - 2/k$, this contradicts the assumption that $f$ has Lipschitz constant much less than $k$.

-


text:
# Browse results

## You are looking at 1 - 8 of 8 items for :

• Classical Studies
• Reference Work
• Encyclopedia
• Epigraphy & Papyrology
• Religion in Antiquity
• Biblical Studies
• Nach Ebene eingrenzen: Titles
Clear All
With Walls of Iron?
Author: Stewart Moore
In Jewish Ethnic Identity and Relations in Hellenistic Egypt, Stewart Moore investigates the foundations of common assumptions about ethnicity. To maintain one’s identity in a strange land, was it always necessary to band tightly together with one’s coethnics? Sociologists and anthropologists who study ethnicity have given us a much wider view of the possible strategies of ethnic maintenance and interaction.

The most important facet of Jewish ethnicity in Egypt which emerges from this study is the interaction over the Jewish-Egyptian boundary. Previous scholarship has assumed that this border was a Siegfried Line marked by mutual contempt. Yet Jews, Egyptians and also Greeks interacted in complicated ways in Ptolemaic Egypt, with positive relationships being at least as numerous as negative ones.
This book explores how early Christian communities constructed, developed, and asserted their identity and authority in various socio-cultural contexts in Asia Minor and Greece in the first five centuries CE. With the help of the database Inscriptiones Christianae Graecae ( ICG), special attention is given to ancient inscriptions which represent a rich and valuable source of information on the early Christians’ social and religious identity, family networks, authority structures, and place and function in society. This collection of essays by various specialists of Early Christianity, Epigraphy, and Late Antiquity, offers a broad geographical survey of the expansion and socio-cultural development of Christianity/ies in Asia Minor and Greece, and sheds new light on the religious transformation of the Later Roman Empire.
Visualisation, Data Mining, Communication
Ancient Manuscripts in Digital Culture presents an overview of the digital turn in Ancient Jewish and Christian manuscripts visualisation, data mining and communication. Edited by David Hamidović, Claire Clivaz and Sarah Bowen Savant, it gathers together the contributions of seventeen scholars involved in Biblical, Early Jewish and Christian studies. The volume attests to the spreading of digital humanities in these fields and presents fundamental analysis of the rise of visual culture as well as specific test-cases concerning ancient manuscripts. Sophisticated visualisation tools, stylometric analysis, teaching and visual data, epigraphy and visualisation belong notably to the varied overview presented in the volume.
From the Margins to the Mainstream
Volume Editors: Stephen Mitchell and Philipp Pilhofer
This volume is part of the Berlin Topoi project re-examing the early Christian history of Asia Minor, Greece and the South Balkans, and is concerned with the emergence of Christianity in Asia Minor and in Cyprus. Five essays focus on the east Anatolian provinces, including a comprehensive evaluation of early Christianity in Cappadocia, a comparative study of the Christian poetry of Gregory of Nazianzus and his anonymous epigraphic contemporaries and three essays which pay special attention to the hagiography of Cappadocia and Armenia Minor. The remaining essays include a new analysis of the role of Constantinople in episcopal elections across Asia Minor, a detailed appraisal of the archaeological evidence from Sagalassus in Pisidia, a discussion of the significance of inscriptions in Carian sanctuaries through late antiquity, and a survey of Christian inscriptions from Cyprus.
Incubation Sanctuaries in the Greco-Roman World
Author: Gil Renberg
Where Dreams May Come was the winner of the 2018 Charles J. Goodwin Award of Merit, awarded by the Society for Classical Studies.

In this book, Gil H. Renberg examines the ancient religious phenomenon of “incubation", the ritual of sleeping at a divinity’s sanctuary in order to obtain a prophetic or therapeutic dream. Most prominently associated with the Panhellenic healing god Asklepios, incubation was also practiced at the cult sites of numerous other divinities throughout the Greek world, but it is first known from ancient Near Eastern sources and was established in Pharaonic Egypt by the time of the Macedonian conquest; later, Christian worship came to include similar practices. Renberg’s exhaustive study represents the first attempt to collect and analyze the evidence for incubation from Sumerian to Byzantine and Merovingian times, thus making an important contribution to religious history.

This set consists of two books.
The Coptic Gnostic Library is the only authoritative edition of many of the Coptic writings of the Gnostics from the first centuries AD. It was originally published by Brill in fourteen hardback volumes as part of the Nag Hammadi (and Manichaean) Studies series between 1975 and 1995, under the general editorship of James M. Robinson.

The Coptic Gnostic Library contains all the texts of the Nag Hammadi codices, both in the original Coptic and in translation. Each text has its own introduction, and full indexes are provided. The Coptic Gnostic Library is the starting point for all research into ancient Gnosticism. It is the result of decades of dedicated research by the most distinguished international scholars in this field.

The Coptic Gnostic Library continues where the Dead Sea Scrolls left off. Our main sources of information for the Gnostic religion are the so-called Nag Hammadi codices, written in Coptic. These were unearthed in 1945 near the town of Nag Hammadi in Upper Egypt. The texts literally begin where the Dead Sea Scrolls end. Their discovery is considered equally significant as the Dead Sea Scrolls themselves, bringing to light a long-hidden wealth of information and insights into early Judaism and the roots of Christianity. Furthermore, these writings clearly show that the Gnostic religion was not only a force that interacted with early Christianity and Judaism in their formative periods, but also a significant religious movement in its own right.

Features and Benefits
- Online edition of the original 14 hardback Nag Hammadi Codices
- Complete and unabridged
- Facing Coptic texts and English translations, Introductions, Notes, and Indexes
- Instant and fully searchable access to the equivalent of more than 5,000 pages of print.
• Institutional outright purchase price €5,909.00$6,854.00 * * Price valid to Dec 31, 2021 • Online subscription price €706.00$819.00 *
* Price valid to Dec 31, 2021
• For further information, contact your sales manager
Religion and Society in Transition
This volume provides a review of recent research in Philippi related to archaeology, demography, religion, the New Testament and early Christianity. Careful reading of texts, inscriptions, coins and other archaeological materials allow the reader to examine how religious practice in Philippi changed as the city moved from being a Hellenistic polis to a Roman colony to a center for Christian worship and pilgrimage. The essays raise questions about traditional understandings of material culture in Philippi, and come to conclusions that reflect more complicated and diverse views of the city and its inhabitants.
Sortilege—the making of decisions by casting lots—was widely practiced in the Mediterranean world during the period known as late antiquity, between the third and eighth centuries CE. In My Lots are in Thy Hands: Sortilege and its Practitioners in Late Antiquity, AnneMarie Luijendijk and William Klingshirn have collected fourteen essays that examine late antique lot divination, especially but not exclusively through texts preserved in Greek, Latin, Coptic, and Syriac. Employing the overlapping perspectives of religious studies, classics, anthropology, economics, and history, contributors study a variety of topics, including the hermeneutics and operations of divinatory texts, the importance of diviners and their instruments, and the place of faith and doubt in the search for hidden order in a seemingly random world.


text:
# Increasing the size of a minipage proportional to the contain

I am trying to create a simple environment. The enviroment contains a minipage that is surrounded but a dashed box.

\NewEnviron{Notes}{
\par
\begin{tikzpicture}
\node[rectangle,minimum width=0.95\textwidth] (m) {
\begin{minipage} {0.75\textwidth}
\color{red}\BODY
\end{minipage}
};
\draw[dashed] (m.south west) rectangle (m.north east);
\end{tikzpicture}\\
}

Essentially, I would like to increase the size of the box proportional to its contain. So, something like: \vspace{0.2*\BODYHeight}

What's the best way of doing this?

-
 the height of the box proportional to the height of its contain ? because the width is fixed 0.75\textwidth ! – Alain Matthes Feb 24 '12 at 23:16 Sorry, I don't understand what you mean. Where does fixing the width present a problem for height? – csgillespie Feb 25 '12 at 2:00 a box has 2 dimensions : width and height. If a box is proportional to another, height and width of the first box must be proportional to the height and width of the second one and I'm not sure that you want. In my answer, only heights are proportional.. The width is fixed by 0.75 \textwidth . – Alain Matthes Feb 25 '12 at 5:28 A bad question, sorry. I meant that keeping the textwidth fixed and adjusting the height. – csgillespie Feb 26 '12 at 20:02

What you can do is to enclose the \BODY with the necessary spacing. Here is a MWE.

\documentclass{article}
\usepackage{environ}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}
\NewEnviron{Notes}{
\par
\begin{tikzpicture}
\node[rectangle,minimum width=0.95\textwidth] (m) {
\begin{minipage} {0.75\textwidth}
\vspace*{0.1\textwidth}
\color{red}\BODY
\vspace{0.1\textwidth}
\end{minipage}
};
\draw[dashed] (m.south west) rectangle (m.north east);
\end{tikzpicture}\\
}

\begin{Notes}
\lipsum[1]
\end{Notes}
\end{document}

A better approach is to rather use a fixed amount of padding:

\documentclass{article}
\usepackage{environ}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}
\NewEnviron{Notes}{
\par
\begin{tikzpicture}
\node[rectangle,minimum width=0.5\textwidth] (m) {
\fbox{\begin{minipage} {0.5\textwidth}
\color{red}\BODY
\end{minipage}}
};
\draw[dashed] (m.south west) rectangle (m.north east);
\end{tikzpicture}\\
}

\begin{Notes}
\lipsum[1]
\end{Notes}
\end{document}

if you add \fboxsep0pt, the inner rule will not be shown. Padding can be increased using a suitable value of \fboxsep. I think this is a much better solution in terms of typography and scales well. Non-linear scaling of the vertical spacing is also possible and one could employ a technique I first encountered in amsgen, latex amsgen.dtx and look up the definition of \compute@ex@. The difficulty is to find an acceptable formula to describe the aesthetics of such spacing. The formula should include for such variables as textwidth, height, font-size and the relationships to the rest of the text.

-
 Thanks, but the gap isn't proportional to the amount of text in the environment. For example, \begin{Notes}Test\end{Notes} should only have a small gap around it. – csgillespie Feb 24 '12 at 21:56 @csgillespie Based on what formula? If the text is very large, it will yield a larger space? A better approach is to use a fixed amount of padding. I will expand in the post. – Yiannis Lazarides Feb 25 '12 at 7:23

Not exactly proportional because eI added 2pt to avoid very small values . It's possible to change .05\htbox with .1\htbox but now the problem comes from big values.

\documentclass{article}
\usepackage{environ}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}

\newbox\mybox
\newdimen\htbox
\newdimen\innersep
\NewEnviron{Notes}{%
\setbox\mybox=\vbox{%
\begin{minipage} {0.75\textwidth}
\color{red}\BODY
\end{minipage}}%
\htbox\ht\mybox
\innersep=.05\htbox
\par
\begin{tikzpicture}
\node[draw,inner sep=\innersep,rectangle,
text width=0.95\textwidth-2\innersep] (m) {\unvcopy\mybox};
\end{tikzpicture}\\
}

\begin{Notes}
Texte
\end{Notes}

\begin{Notes}
\lipsum[1]
\end{Notes}

\end{document}

-
 Nice solution. See the additional notes in my answer regarding proportional spacing. – Yiannis Lazarides Feb 25 '12 at 7:44 Yes I saw your comment and I agree with you, a fixed amount of padding is preferable but perhaps I don't understand the aim of the requirement about proportionality. – Alain Matthes Feb 25 '12 at 8:21 I am not sure either, but whatever it shouldn't be a linear function. – Yiannis Lazarides Feb 25 '12 at 8:44