# indicator_sdr: Spectral Density Ratio (SDR) indicator In spatialwarnings: Spatial Early Warning Signals of Ecosystem Degradation

## Description

Compute the ratio of low frequencies over high frequencies of the r-spectrum. It also computes a null value obtained by randomizing the matrix.

## Usage

 ```1 2``` ```indicator_sdr(input, sdr_low_range = NULL, sdr_high_range = NULL, nreplicates = 999) ```

## Arguments

 `input` A matrix or a logical matrix (TRUE/FALSE), or a list of these. `sdr_low_range` The range of values (in proportion) to use for the computation of the spectral density ratio. For example, for the lowest 20% (default value), set `sdr_low_range` to `c(0, .2)`. `sdr_high_range` The range of values (in proportion) to use for the computation of the spectral density ratio. For example, for the highest 20% (default value), set `sdr_high_range` to `c(.8, 1)`. `nreplicates` The number of replicates to compute for the null distribution

## Details

SDR measures the increase in long-range correlations before a critical point. It is the ratio of the average low frequency value over high frequency values. In this implementation, an increase in SDR implies a "reddening" of the r-spectrum. See also `spectral_spews` for a more complete description.

Low and high frequencies are averaged in order to compute the SDR. The parameters `sdr_low_range` and `sdr_high_range` control which frequencies are selected for averaging. For example `sdr_low_range = c(0, .2)` (default) uses the lower 20 the average of low frequencies. `sdr_high_range = c(.8, 1)` uses the higher 20

## Value

A list (or a list of lists if input was a list of matrices) with components:

• 'value': SDR of the matrix

If nreplicates is above 2, then the list has the following additional components :

• 'null_mean': Mean SDR of the null distribution

• 'null_sd': SD of SDR in the null distribution

• 'z_score': Z-score of the observed value in the null distribution (value minus the null mean and divided by null standard deviation)

• 'pval': p-value based on the rank of the observed SDR in the null distribution. A low p-value means that the indicator value is significantly higher than the null values.

## References

Carpenter, S.R. & Brock, W.A. (2010). Early warnings of regime shifts in spatial dynamics using the discrete Fourier transform. Ecosphere

 ```1 2 3 4 5``` ```## Not run: serengeti.sdr <- indicator_sdr(serengeti, nreplicates = 499) do.call(rbind, serengeti.sdr) # convert results to data.frame ## End(Not run) ```