remap.cumsum: Cumulative values

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

View source: R/remap.cumsum.R

Description

This function remaps a time series into its cumulative summation.

Usage

1
remap.cumsum(z, is.pc = FALSE, base = 0)

Arguments

z

a zoo object indexed by event time, typically by the “z.e” component obtained from “phys2eventtime” function.

is.pc

‘logical’, whether input is a percentage. Default value set to ‘FALSE’.

base

an integer specifying the base for cumulative sum.

Details

This function remaps a time series into ints cumulative summation. Function assigns first value as zero in the event window (-width) before cumulating the values.

Value

A zoo object with the cumulative summation for each series.

Author(s)

Chirag Anand, Vikram Bahure, Vimal Balasubramaniam

See Also

phys2eventtime

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(StockPriceReturns)
data(SplitDates)

es.results <- phys2eventtime(z = StockPriceReturns,
                             events = SplitDates,
                             width = 5)
es.w <- window(es.results$z.e, start = -5, end = +5)
eventtime <- remap.cumsum(es.w, is.pc = FALSE, base = 0)

print(eventtime[as.character(-3:3), ])

eventstudies documentation built on July 4, 2017, 9:46 a.m.