period.prod: Calculate Product By Period

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculate a product for each period of INDEX. Essentially a rolling application of prod over a series of non-overlapping sections.

Usage

1
period.prod(x, INDEX)

Arguments

x

a univariate data object

INDEX

a vector of breakpoints to calculate product on

Details

Used to calculate a product per period given an arbitrary index of sections to be calculated over. This is an optimized function for product. There are additionally optimized versions for min, max, and sum.

For xts-coercible objects, an appropriate INDEX can be derived from a call to endpoints.

Value

An xts or zoo object of products, indexed by the period endpoints.

Author(s)

Jeffrey A. Ryan

See Also

endpoints, period.sum, period.min, period.max

Examples

1
2
3
4
5

R-Finance/xts documentation built on May 8, 2019, 4:51 a.m.