excess: Excess from a baseline

Description Usage Arguments Details Value References See Also Examples

View source: R/excess.R

Description

excess computes the relative excesses of x relatively to a baseline. excess_inverse reverts the process.

Usage

1
2
3
excess(x, expected, fact = 100, ...)

excess_inverse(excess, expected, fact)

Arguments

x

Numeric vector. Contains original data.

expected

Numeric vector the same length as x. The baseline used in the computation of excesses. If missing in excess, the function baseline is called with the additional arguments passed in .... If missing in excess_inverse, the attribute baseline is used if present.

fact

Numeric. A factor to apply to the relative excess. Default to 100 to express excesses in percentage.

...

Arguments to be passed to baseline if expected is missing. See ?baseline.

excess

Numeric vector. A series of excesses to be reverted to the original scale of x.

Details

Compute relative excesses from a baseline. Excesses are computed as:

excess = (x - expected) / expected * fact

Value

excess: A numeric vector of class excess the same length as x.In addition, contains the attributes baseline and fact to keep track of the computation.

excess_inverse: A numeric vector the same length as excess.

References

Chebana F., Martel B., Gosselin P., Giroux J.X., Ouarda T.B.M.J., 2013. A general and flexible methodology to define thresholds for heat health watch and warning systems, applied to the province of Quebec (Canada). International journal of biometeorology 57, 631-644.

See Also

baseline for computing expected values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  library(dlnm)
  data(chicagoNMMAPS)
  x <- chicagoNMMAPS$death
  dates <- as.POSIXlt(chicagoNMMAPS$date)

  om <- excess(x, dates = dates, order = 15)
  xrec <- excess_inverse(om)

  plot(dates, x)
  lines(dates, xrec, col = "red")

PierreMasselot/hhws documentation built on May 25, 2019, 4:01 a.m.