ctre: CTRE model

Description Usage Arguments Value See Also Examples

View source: R/new_ctre.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
9
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')

CTRE documentation built on May 2, 2019, 9:34 a.m.