Learn R Programming

CTRE (version 0.1.0)

ctre: CTRE model

Description

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

Usage

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

CTRE

Examples

Run this code
# NOT RUN {
times <- cumsum(MittagLeffleR::rml(n = 1000, tail = 0.8, scale = 5))
magnitudes <- rexp(n = 1000)
sim_ctre <- ctre(times, magnitudes)
sim_ctre
plot(sim_ctre)

library(magrittr)
bitcoin_ctre <- bitcoin %>% ctre() %>% thin(k = 400)
plot(bitcoin_ctre, log = 'y')
# }

Run the code above in your browser using DataLab