Colwells: Colwells indices

Description Usage Arguments Details Value Author(s) References Examples

Description

Calculates Colwell's (1974), which provide a measure of the seasonal predictability of environmental phenomena. Defined in terms of Predictability (P), Constancy (C) and Contingency (M). For detailed information on the calculation and description of Colwell's indices refer to (Colwell, 1974).

Usage

1
2
3
Colwells(flow.ts, fn = "mean",
boundaries = "transform", s = 11,
base.binning = 2, from = 0.5, by = 0.25, base.entropy=2, indices.only=FALSE)

Arguments

flow.ts

Dataframe with date and discharge data in columns named "Date" and "Q" respectively. Date must be in POSIX format (see ts.format). Missing values are ignored.

fn

The function used to summarise daily data (default mean) and for scaling break points when binning data. Can also use median, min, max.

boundaries

The method used to define break points when binning data.

boundaries="equal" splits the data into s equal sized bins

boundaries="transform" (default) first applies a log10(x+1) transformation and then splits the data into s equal size bins

boundaries="log_class_size" generates breaks based on logarithmic scale (default base 2) with a roughly equal number of bins above and below 1

boundaries="weighted_log_class_size" generates breaks based on logarithmic scale (default base 2) * mean (or other summary statistic) of the variable. A roughly equal number of bins occur above and below the mean (or other summary statistic)

boundaries="Gan" creates bins that match those of Gan et al. (1991). Requires: from (default 0.25), by (default 0.25) and s (number of bins)

s

The number of classes the flow data is broken into (default 11)

base.binning

The base integer for defining classes when using the "log_class_size" or "weighted_log_class_size" boundaries

from

The lowest break point for defining classes when using the "Gan" boundaries (default 0.25)

by

The bin width when using the "Gan" boundaries (default 0.25)

base.entropy

The base integer used for the entropy calculations (default=2)

indices.only

Logical. If FALSE (default), the function returns a list of length 3, including the breaks, a table of frequencies, and Colwell's indices. If TRUE, the function returns just a dataframe of indices, useful for combining output with that from other functions.

Details

Predictability measures how tightly an event is linked to a season; Constancy measures how uniformly the event occurs through all seasons, and Contingency measures the repeatability of season patterns. Predictability is the sum of Constancy and Contingency, and reflects the likelihood of being able to predict a flow occurrence. It is maximized when the flow is constant throughout the year (Constancy Maximised), or if the pattern of high or low flow occurrence is repeated across all years (Contingency maximized).

Value

A list or dataframe (see above).

breaks

shows the break points used between classes. Not returned for all boundary options. The upper and lower classes are always open even if -Inf/Inf are not shown.

flow.table

Table showing the number of times the monthly flows fall into each flow class in each month. Useful for examining the results of different binning techniques.

P

Predictability

C

Constancy

M

Contingency

CP

C/P

MP

M/P

Author(s)

Nick Bond <n.bond@latrobe.edu.au>

References

Colwell, R.K. 1974. Predictability, constancy, and contingency of periodic phenomena. Ecology 55(5): 1148-53.

Gan, K.C., McMahon, T.A., and Finlayson, B.L. 1991. Analysis of periodicity in streamflow and rainfall data by Colwell's indices. Journal of Hydrology 123(1-2): 105-18.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(Cooper)
Cooper<-ts.format(Cooper)

Colwells(Cooper, s=5)
Colwells(Cooper, boundaries="equal", s=11)
Colwells(Cooper, boundaries="log_class_size", s=11)
Colwells(Cooper, boundaries="weighted_log_class_size", s=11)

Colwells(Cooper, boundaries="Gan", from=1,by=1, s=4)
Colwells(Cooper, boundaries="Gan", from=0.25,by=0.25, s=9)

Colwells(Cooper, boundaries="Gan", from=0.25,by=0.25, s=9, indices.only=TRUE)



require(plyr)
data(Acheron)
Acheron<-ts.format(Acheron)
flow.ts<-rbind(data.frame(River="Acheron", Acheron), data.frame(River="Cooper", Cooper))

ddply(flow.ts, .(River), function(x)
Colwells(x, boundaries="weighted_log_class_size", s=11, indices.only=TRUE))

Example output

$breaks
[1] "see Table"

$flow.table
                 month
flow.class        01 02 03 04 05 06 07 08 09 10 11 12
  [-0.00575,1.15)  2  2  2  4  6  7  9 14 17 14 11  7
  [1.15,2.3)       1  0  2  2  5  5  6  4  2  3  2  3
  [2.3,3.45)       9  5  3  9  6  5  3  2  2  4  5  4
  [3.45,4.6)       8  9 12  5  4  4  3  1  0  0  3  7
  [4.6,5.76]       1  5  2  1  0  0  0  0  0  0  0  0

$P
[1] 0.27

$C
[1] 0.11

$M
[1] 0.16

$CP
[1] 0.4074074

$MP
[1] 0.5925926

$breaks
[1] "see Table"

$flow.table
                     month
flow.class            01 02 03 04 05 06 07 08 09 10 11 12
  [-568,5.16e+04)     20 17 19 20 21 21 21 21 21 21 21 21
  [5.16e+04,1.03e+05)  0  2  1  1  0  0  0  0  0  0  0  0
  [1.03e+05,1.55e+05)  0  1  1  0  0  0  0  0  0  0  0  0
  [1.55e+05,2.06e+05)  0  0  0  0  0  0  0  0  0  0  0  0
  [2.06e+05,2.58e+05)  1  0  0  0  0  0  0  0  0  0  0  0
  [2.58e+05,3.1e+05)   0  0  0  0  0  0  0  0  0  0  0  0
  [3.1e+05,3.61e+05)   0  0  0  0  0  0  0  0  0  0  0  0
  [3.61e+05,4.13e+05)  0  0  0  0  0  0  0  0  0  0  0  0
  [4.13e+05,4.65e+05)  0  0  0  0  0  0  0  0  0  0  0  0
  [4.65e+05,5.16e+05)  0  0  0  0  0  0  0  0  0  0  0  0
  [5.16e+05,5.68e+05]  0  1  0  0  0  0  0  0  0  0  0  0

$P
[1] 0.95

$C
[1] 0.93

$M
[1] 0.02

$CP
[1] 0.9789474

$MP
[1] 0.02105263

$breaks
 [1]  -Inf   0.5   1.0   2.0   4.0   8.0  16.0  32.0  64.0 128.0 256.0 512.0
[13]   Inf

$flow.table
            month
flow.class   01 02 03 04 05 06 07 08 09 10 11 12
  (-Inf,0.5]  2  1  2  3  5  6  8 10 15 13 11  7
  (0.5,1]     0  0  0  0  0  1  0  2  0  0  0  0
  (1,2]       0  0  0  1  0  0  0  0  0  1  0  0
  (2,4]       0  0  0  0  0  0  1  1  0  0  0  0
  (4,8]       0  0  0  0  0  0  0  1  0  0  0  0
  (8,16]      0  1  0  0  1  0  0  0  2  0  0  1
  (16,32]     0  0  1  0  1  1  1  1  1  0  1  0
  (32,64]     1  0  0  0  2  1  1  0  1  1  0  0
  (64,128]    0  0  1  2  2  2  4  1  0  2  1  1
  (128,256]   0  0  0  0  1  1  1  2  0  0  0  1
  (256,512]   3  0  0  3  2  2  1  1  0  0  1  0
  (512, Inf] 15 19 17 12  7  7  4  2  2  4  7 11

$P
[1] 0.49

$C
[1] 0.34

$M
[1] 0.15

$CP
[1] 0.6938776

$MP
[1] 0.3061224

$breaks
 [1]     -Inf  0.03125  0.06250  0.12500  0.25000  0.50000  1.00000  2.00000
 [9]  4.00000  8.00000 16.00000      Inf

$flow.table
                     month
flow.class            01 02 03 04 05 06 07 08 09 10 11 12
  [-Inf,269)           3  2  4  6 12 12 16 18 19 17 13 10
  [269,538)            3  0  0  3  2  2  1  1  0  0  1  0
  [538,1.08e+03)       2  2  0  3  1  1  1  0  2  2  2  1
  [1.08e+03,2.15e+03)  1  3  1  2  2  2  0  0  0  1  2  2
  [2.15e+03,4.3e+03)   4  0  2  4  0  1  2  2  0  1  1  3
  [4.3e+03,8.6e+03)    2  2  2  2  2  1  0  0  0  0  2  4
  [8.6e+03,1.72e+04)   2  2  7  0  0  0  1  0  0  0  0  1
  [1.72e+04,3.44e+04)  2  4  3  0  2  2  0  0  0  0  0  0
  [3.44e+04,6.88e+04)  1  2  0  0  0  0  0  0  0  0  0  0
  [6.88e+04,1.38e+05)  0  3  2  1  0  0  0  0  0  0  0  0
  [1.38e+05, Inf]      1  1  0  0  0  0  0  0  0  0  0  0

$P
[1] 0.45

$C
[1] 0.28

$M
[1] 0.17

$CP
[1] 0.6222222

$MP
[1] 0.3777778

$breaks
[1] 1 2 3

$flow.table
                     month
flow.class            01 02 03 04 05 06 07 08 09 10 11 12
  [-Inf,8.6e+03)      15  9  9 20 19 19 20 21 21 21 21 20
  [8.6e+03,1.72e+04)   2  2  7  0  0  0  1  0  0  0  0  1
  [1.72e+04,2.58e+04)  1  2  3  0  1  1  0  0  0  0  0  0
  [2.58e+04, Inf]      3  8  2  1  1  1  0  0  0  0  0  0

$P
[1] 0.72

$C
[1] 0.59

$M
[1] 0.13

$CP
[1] 0.8194444

$MP
[1] 0.1805556

$breaks
[1] 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00

$flow.table
                     month
flow.class            01 02 03 04 05 06 07 08 09 10 11 12
  [-Inf,2.15e+03)      9  7  5 14 17 17 18 19 21 20 18 13
  [2.15e+03,4.3e+03)   4  0  2  4  0  1  2  2  0  1  1  3
  [4.3e+03,6.45e+03)   1  1  1  1  2  1  0  0  0  0  0  3
  [6.45e+03,8.6e+03)   1  1  1  1  0  0  0  0  0  0  2  1
  [8.6e+03,1.08e+04)   0  1  3  0  0  0  1  0  0  0  0  0
  [1.08e+04,1.29e+04)  0  1  2  0  0  0  0  0  0  0  0  1
  [1.29e+04,1.51e+04)  2  0  2  0  0  0  0  0  0  0  0  0
  [1.51e+04,1.72e+04)  0  0  0  0  0  0  0  0  0  0  0  0
  [1.72e+04, Inf]      4 10  5  1  2  2  0  0  0  0  0  0

$P
[1] 0.63

$C
[1] 0.5

$M
[1] 0.14

$CP
[1] 0.7936508

$MP
[1] 0.2222222

     P   C    M        CP        MP
1 0.63 0.5 0.14 0.7936508 0.2222222
Loading required package: plyr
    River    P    C    M        CP        MP
1 Acheron 0.52 0.31 0.21 0.5961538 0.4038462
2  Cooper 0.45 0.28 0.17 0.6222222 0.3777778

hydrostats documentation built on May 6, 2019, 1:02 a.m.