Learn R Programming

fluxweb (version 0.2.0)

make.stability: making network stability

Description

Find the smallest scalar multiplying a variable from losses insuring system stability

Usage

make.stability(val.mat, biomasses, losses, efficiencies, growth.rate,
  losses.scale = NULL, bioms.prefs = TRUE, bioms.losses = TRUE,
  ef.level = "prey", interval = c(1e-12, 1), ...)

Arguments

val.mat

A matrix describing fluxes between species (usually a result of fluxing function).

biomasses

A vector of species biomasses.

losses

A vector or an array of species energy losses (excluding predation).

efficiencies

A vector or an array of conversion efficiencies of species in the adjacency matrix. These values describe the proportion of consumed energy that is converted to biomass of the consumer.

growth.rate

A vector defining growth rate of basal species.

losses.scale

Defines a Column from losses on which scalar multiplication will be tested. (default NULL if the value is independent of losses).

bioms.prefs

Logical, if TRUE (default) preferences are scaled accordingly to species biomasses.

bioms.losses

Logical, if TRUE (default) losses are scaled with biomass.

ef.level

Set to "prey" if efficiencies are defined by prey, "pred" if they are a property of the predator.

interval

Search interval for returned value.

...

Optional parameters for function uniroot

Value

A list from uniroot function.

Details

The function assumes a monotonous increase of stability with multiplication by a scalar value. Solution is estimated from the uniroot function, and stability using the fluxing function Thus, accordingly to uniroot solving criteria, if stability values at the two extremum parts of the interval are of same sign, an error is raised.

Behavior of the multiplicative term depends on the type of losses:

  • losses.scale = NULL and is.vector(losses): multiplication will be applied to the losses vector.

  • losses.scale = NULL and is.matrix(losses): multiplication will be independent of any columns from losses.

  • losses.scale = FALSE : value used for multiplication always independent of losses.

  • other values: should refer to an element of losses.

See Also

uniroot for root estimate and stability.value for assessing system stability.

Examples

Run this code
# NOT RUN {
losses = 0.15 * groups.level$bodymasses^(-0.25)

# growth rates of basal sppecies
growth.rates = rep(NA, dim(groups.level$mat)[1])
growth.rates[colSums(groups.level$mat) == 0] = 0.5

val.mat = fluxing(groups.level$mat, 
                  groups.level$biomasses, 
                  losses, 
                  groups.level$efficiencies, 
                  bioms.pref = TRUE, 
                  ef.level = "pred")
make.stability(val.mat, 
               groups.level$biomasses, 
               losses, 
               groups.level$efficiencies, 
               growth.rates, 
               ef.level = "pred")

# }

Run the code above in your browser using DataLab