Learn R Programming

popdemo (version 0.1-2)

Cohen.cumulative: Calculate Cohen's cumulative distance

Description

Calculate Cohen's cumulative distance metric for a given population projection matrix (PPM) model.

Usage

Cohen.cumulative(A, vector)

Arguments

A
a square, irreducible, non-negative numeric matrix of any dimension.
vector
a specified initial age/stage distribution of class vector or class matrix.

Value

  • Cohen's D1.

Details

Calculates the cumulative distance metric as outlined in Cohen (1979). Cohen.cumulative will not work for reducible matrices and returns a warning for imprimitive matrices (although will not function for imprimitive matrices with nonzero imaginary components in the dominant eigenpair).

References

Cohen (1979) SIAM J. Appl. Math., 36, 169-175. Stott et al. (2011) Ecol. Lett., 14, 959-970.

Examples

Run this code
# Create a 3x3 PPM
    A <- matrix(c(0,1,2,0.5,0.1,0,0,0.6,0.6), byrow=TRUE, ncol=3)
    A

    # Create an initial stage structure
    initial <- c(1,3,2)
    initial

    # Calculate Cohen cumulative distance
    Cohen.cumulative(A, vector=initial)

Run the code above in your browser using DataLab