Creates an object of class 'ctre' (Continuous Time Random Maxima).

ctre(x, y = NULL, drop.duplicate.times = FALSE)

Arguments

x

Either

  • a data.frame with two columns, or

  • a vector; then y must be a vector of same length, or

  • a zoo object.

The first component/column must contain the event times and be of class "numeric", "Date" or "POSIXct"; the second component/column must contain the event magnitudes and be of type "numeric".

y

If x is a vector, y needs to be supplied as a vector of same length.

drop.duplicate.times

If there are duplicate time stamps present, should duplicates be dropped?

Value

An object of class 'ctre' based on a time series of magnitudes.

See also

Examples

times <- cumsum(MittagLeffleR::rml(n = 1000, tail = 0.8, scale = 5)) magnitudes <- rexp(n = 1000) sim_ctre <- ctre(times, magnitudes) sim_ctre
#> 'ctre' object with 1000 timestamps and magnitudes. #> Timestamps: #> num [1:1000] 2.98 4.36 12.57 19.65 30.59 ... #> Magnitudes: #> num [1:1000] 0.5016 0.8388 1.042 1.7023 0.0333 ...
plot(sim_ctre)
library(magrittr) bitcoin_ctre <- bitcoin %>% ctre() %>% thin(k = 400) plot(bitcoin_ctre, log = 'y')