pe_mv: Estimate the mean-variance portfolio effect

Description Usage Arguments Details Value References Examples

View source: R/pe_mv.r

Description

Takes a matrix of abundance or biomass data and returns various estimates of the mean-variance portfolio effect. Options exist to fit various mean-variance models and to detrend the time series data.

Usage

1
2
pe_mv(x, type = c("linear", "linear_robust", "quadratic", "linear_quad_avg",
  "linear_detrended", "loess_detrended"), ci = FALSE, na.rm = FALSE)

Arguments

x

A matrix or dataframe of abundance or biomass data. The columns should represent different subpopulations or species. The rows should represent the values through time.

type

Type of model to fit to the log(variance)-log(mean) data. Options are:

  • linear: linear regression (the default),

  • linear_robust: robust linear regression

  • quadratic: quadratic regression

  • linear_quad_avg: AICc-weighted model averaging of linear and quadratic regression

  • linear_detrended: detrend the time series with a linear model before estimating z from a linear regression

  • loess_detrended: detrend the time series with a loess smoother before estimating z from a linear regression

ci

Logical value describing whether a 95% confidence interval should be calculated and returned (defaults to TRUE).

na.rm

A logical value indicating whether NA values should be row-wise deleted.

Details

This version of the portfolio effect consists of dividing the CV of a theoretical single population (single asset system) that has the same overall mean but with the variance scaled according to the mean-variance relationship by the CV of the combined total population. The calculation of the portfolio CV is the same as in pe_avg_cv but the calculation of the single asset system CV is different.

Currently, confidence intervals can only be returned for linear, linear_detrended, and loess_detrended. Otherwise, the value of ci will be automatically turned to FALSE. It is not obvious what a confidence interval should be given that the quadratic term in the quadratic and linear-quadratic averaged versions are bounded at 0.

Value

A numeric value representing the portfolio effect that takes into account the mean-variance relationship. If confidence intervals were requested then a list is returned with the portfolio effect (pe) and 95% confidence interval (ci).

References

Anderson, S.C., A.B. Cooper, N.K. Dulvy. 2013. Ecological prophets: Quantifying metapopulation portfolio effects. Methods in Ecology and Evolution. In Press.

Doak, D., D. Bigger, E. Harding, M. Marvier, R. O'Malley, and D. Thomson. 1998. The Statistical Inevitability of Stability-Diversity Relationships in Community Ecology. Amer. Nat. 151:264-276.

Tilman, D., C. Lehman, and C. Bristow. 1998. Diversity-Stability Relationships: Statistical Inevitability or Ecological Consequence? Amer. Nat. 151:277-282.

Tilman, D. 1999. The Ecological Consequences of Changes in Biodiversity: A Search for General Principles. Ecology 80:1455-1474.

Taylor, L. 1961. Aggregation, Variance and the Mean. Nature 189:732-735. doi: 10.1038/189732a0.

Taylor, L., I. Woiwod, and J. Perry. 1978. The Density-Dependence of Spatial Behaviour and the Rarity of Randomness. J. Anim. Ecol. 47:383-406.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(pinkbr)
pe_mv(pinkbr[,-1], ci = TRUE)
## Not run: 
pe_mv(pinkbr[,-1], type = "quadratic") # same as linear in this case
pe_mv(pinkbr[,-1], type = "linear_quad_avg")
pe_mv(pinkbr[,-1], type = "linear_robust")
pe_mv(pinkbr[,-1], type = "linear_detrended", ci = TRUE)
pe_mv(pinkbr[,-1], type = "loess_detrended", ci = TRUE)

## End(Not run)

seananderson/ecofolio documentation built on May 29, 2019, 4:25 p.m.