This web application implements the methods
for measuring temporal change in communities described
in Spencer (2015)^{1}. The paper introduces a measure of change
in relative abundances (the “shape” of a community) that
complements measures of mean proportional change in abundance
(the “size” of a community) such as the Living Planet Index^{2}
(Loh et al. 2005, link).

The application also implements a wide range of
other measures of change in relative abundance, reviewed
in Spencer (2015)^{1}, and offers interactive
visualization of results. Uncertainty in abundance
data can be handled through interval arithmetic,
approximate confidence intervals based on simple
sampling models, or through user-supplied Monte Carlo estimates.

An R package implementation is also available on GitHub

Spencer (2015) takes an axiomatic approach to choosing a measure of change
in relative abundances. The most important property is that proportional growth
rates contain all the relevant information about habitat quality from an organism's
point of view. This leads to the recommendation that the among-species standard
deviation of proportional population growth rates be used to measure change in
relative abundances. The “shape” change measure developed in Spencer (2015)^{1}
follows this recommendation. It complements measures based on the among-species mean of
proportional population growth rates, such as the Living Planet Index
(Loh et al. 2005, link).

One obvious challenge with measures of proportional change is that colonization and extinction events, which undoubtedly occur, represent larger changes than any change in abundance that does not involve colonization or extinction. The application uses Surreal Arithmetic to describe colonization and extinction events in a way that satisfies this requirement.

Other measures of change in relative abundance may also be useful,
such as those developed by Foster and Tilman (2000)^{3}, Jassby and Goldman (1974)^{4},
Lewis (1978)^{6}, and measures based on Bray-Curtis (Field et al., 1982)^{5} or chi-square
(Legendre and Gallagher, 2001)^{7} distances. The application implements all of these.

Users can upload data as plain text or .Rdata files. The data for each species can be scalar-valued (point estimates), interval-valued (lower and upper bounds on abundance), or a set of Monte Carlo samples (e.g. from a Bayesian population model).

### Uploading vs. Committing

The first tab users will see is the *Data* tab on the right. This is where they can upload their own datasets for personal use,
or select datasets uploaded by other users. If they wish, users can commit their datasets to the public database. This 'Commit' option will
upload the dataset permanently, allowing other users to use the dataset on the application.

### Uploading

Under the upload tab, users can select a file to upload, this file can be in the form of a text/csv file, R data frame, or R matrix/array. datasets can be scalar (single point values over time), interval (left and right endpoints), or Monte Carlo simulation results.

#### Scalar datasets

Scalar datasets should be have the form shown below, with each variable (time included) contained in each column of the table.

If users wish they can add uncertainty to scalar data using one of two methods: Square root uncertainty or Poisson uncertainty. The square root approach
transforms each data point *x* into an interval [* x + a*sqrt(x)*,* x - a*sqrt(x)*] where *a*
is a constant determined by the user (set to 2 by default). Poisson uncertainty assumes a poisson counting process while collecting the data, and calculates
the intervals based on a percent confidence level given by the user (set to 95% by default).

#### Interval datasets

Interval datasets should take the form of a 3D array, consisting of two tables such as the one shown above. The first table should contain the left endpoints of the dataset, and the second should contain the right endpoints of the dataset.

Download Example Dataset#### Monte Carlo Simulations

As with interval datasets, Monte Carlo simulation results should take the form of a 3D array, consisting of *n* tables, where each table is an individual replicate.

### Committing

If users wish, they can upload data to the public database, allowing other users access to their data. By default, datasets are shared under the Creative Commons CC BY license with attribution. This means that anyone using your datset must give you credit as the source. More details on the license can be found <a href = 'http://creativecommons.org/licenses/by/4.0/legalcode'>here</a>. If you wish, you can select a different license to share the data under. This should be specified under the License field when committing the data.

If you accidentally commit your dataset, you can delete it from the database using the 'Undo Commit' botton by specifying the title of the dataset in the 'Title' field.

Uncertainty is handled in one of three ways by RAMAS Community. Besides the default for scalar data (no uncertainty), users can either upload scalar data and convert it to interval data, upload interval data, or upload Monte Carlo simulation results.

### Converting Scalar Datasets to Interval Data

If a user's dataset is scalar, there are two options for converting it into an interval dataset:

#### Square Root Method

This method, given a parameter p (usually between 1 and 3), sends each data point x to x +/- p*sqrt(x)

#### Poisson Confidence Interval Method

This method assumes a Poisson counting process when collecting abundance data, from this it can calculate percent confidence intervals for each of the abundance values. Users can input any value from 1-99.9%.

### Interval Datasets

Interval datasets, as explained in the 'Uploading data' pane, consist of left and right endpoints for each abundance value (lower and upper bounds, respectively). Using interval arithmetic, the application can calculate lower and upper bounds on the shape change measures discussed by Spencer.

For example, suppose we want to 'intervalize' the equation for proportional growth rates of a species, given in the following equation: (note that x<sub>i</sub>(t) represents the abundance of the i<sup>th</sup> species at time t)

$$r_i = \frac{log({x_i}(t + \Delta t)) - log({x_i}(t))}{\Delta t}$$We'll start by defining an interval x:

$$x = [\underline{x},\bar{x}]$$Where __x__ represents the lower bound of x, and x represents the upper bound of x.

We see that to minimize r_{i}, we must take the minimum value of log(x_{i}(t + dt))
and the maximum value of log(x_{i}(t)):

Likewise, in order to maximize r_{i}, we must take the maximum value of log(x_{i}(t + dt))
and the minimum value of log(x_{i}(t)):

Using these two formulas for the lower and upper bounts of r<sub>i</sub>, we can then calculate the associated interval value of r<sub>i</sub>.

### Monte Carlo Datasets

Monte Carlo datasets are generated by the user, and uploaded to the application. For each iterate, the shape change measures are calculated, and saved as a separate iterate. At the end, results are displayed for all of the iterates at once. Users can also apply a confidence interval to these results using the Highest Posterior Density interval, effectively converting the Monte Carlo results into Interval-valued results.

The charts tab contains two subtabs, for single and Two-variable charts. The key difference is that the first tab plots the chosen variable versus time, whereas the second tab plots two chosen variables against one another.

The charts fall into 3 general categories: Scalar, Interval, and Monte Carlo. The appearance and layout of the charts automatically change to fit the type of dataset being visualized.

Within the tabs, the user will find a variable selection tool to the right of the chart display area. There are two dropdown menus here, the first containing the broad category of the variable, and the second containing the variable itself (selecting from the broader category). These are summaries of each of the categories:

### Abundances

This category contains abundances for each of the species. The user can select multiple abundances to plot against time alongside one another, or only one species. If users wish to see the log abundances (by default abundances are stored as their real values), they can simply select the 'log transform' option in the sidebar to the right.

### Proportional Growth Rates

This category contains the proportional growth rates of each of the species, which gives us an idea of how rapidly
a species is increasing or decreasing in abundance.
Letting x_{i} be the abundance of species i, the proportional growth rate
r_{i} of the i^{th} species at time t is defined as follows:

### Relative Abundances

This category contains the relative abundances of each species at each point in time. Let
p_{i}(t) represent the relative abundance of the i^{th} species at time t: (n is the number of species)

### Unit Sphere Projections

This is a slightly more esoteric way of describing species abundances, and was first proposed by
Jassby and Goldman (1974)^{4}. Let e_{i}(t) be the sphere projection of the i^{th} species
at time t: (This is used in Jassby and Goldman's shape change measure, the formula for which is given later on in this section)

### Shape Change Measures

This category contains the 5 measures that make up the focus of this application. These measures are meant to measure how the 'shape' of a community changes over time.

#### Spencer

This measure was created by Matthew Spencer^{1} and is given by the following formula:

where

$$r(t) = \sum\limits_{i=1}^n {r_i}(t)$$#### Foster and Tilman

This measure was described by Foster and Tilman (2000)^{3} and is given by the following formula:

#### Jassby and Goldman

This measure was described by Jassby and Goldman (1974)^{4} and is given by the following formula:

#### Lewis

This measure was described by Lewis (1978)^{6} and is given by the following formula:

#### Bray-Curtis Field

This measure was described in Bray-Curtis (Field et al., 1982)^{5} and is given by the following formula:

where

$${k_i}(t) = [{p_i}(t)]^{\frac{1}{4}} $$#### Rate of Size Change

This isn't a measure of shape change - rather, it is a measure of how fast the community is growing. It is given by the following formula:

$$s(t) = \frac{\sum\limits_{i=1}^n {p_i}(t) }{n}$$### Surreal

In his paper, Spencer discussed an approach to dealing with extinction events that used surreal numbers. This charting option is only available for Spencer's shape change measure on scalar data, and consists of a line plot, where each point along the line is accompanied by an arrow. The length of the arrow is determined by the real part of the surreal number, and the position of the point is determined by the infinite part of the surreal number. More details on this method can be found in Spencer's paper.

#### Citations

**1**: Spencer, M. (2015). Size change, shape change, and the growth space of a community. Journal of Theoretical Biology 369:23-41.
http://dx.doi.org/10.1016/j.jtbi.2015.01.002

**2**: Loh, J., Green, R. E., Ricketts, T., Lamoreux, J., Jenkins, M., Kapos, V., Randers, J., 2005. The Living Planet
Index: using species population time series to track trends in biodiversity. Philosophical Transactions of the Royal
Society B 360, 289–295.

**3**: Foster, B. L., Tilman, D., 2000. Dynamic and static views of succession: Testing the descriptive power of the
chronosequence approach. Plant Ecology 146, 1–10.

**4**: Jassby, A. D., Goldman, C. R., 1974. A quantitative measure of succession rate and its application to the phyto- plankton
of lakes. American Naturalist 108, 688–693.

**5**: Field, J. G., Clarke, K. R., Warwick, R. M., 1982. A practical strategy for analysing multispecies distribution
patterns. Marine Ecology Progress Series 8, 37–52.

**6**: Lewis Jr., W.M., 1978. Analysis of succession in a tropical phytoplankton community and a new measure of succession rate. Am. Nat. 112, 401-414.

**7**: Legendre, P., Gallagher, E.D., 2001. Ecologically meaningful transformations for ordination of species data. Oecologia 129, 271-280.

### Created by:

**Lead developers**

- Scott Ferson (Ph.D)
- Nick Friedenberg (Ph.D)

**Lead developers**

- Luke Green

### Funded by:

**NERC Grant NE/K00297X/1 awarded to M. Spencer**

**Description:**