Event time

Event time is the fundamental concept of the event study. When an event study is performed, windows around each event are extracted, and re-indexed to an "event time" where the event occurs at $t=0$.

EventStudies.jl offers a simple interface to perform direct conversion of a timeseries and a set of events to event time, with the physical_to_event_time function:

EventStudies.physical_to_event_timeFunction
physical_to_event_time(timeseries::TSFrame, event_times::Vector{Pair{Symbol, T}}, window::Union{Integer, AbstractVector{<: Integer}}, model = nothing) where T

Converts the input TSFrame to a vector of TSFrames - one per successful event, centered around the event time.

Arguments are the same as eventstudy. Note that model is not applied here, but its contents are checked to ensure that the model has data in that span.

Returns a tuple (event_tsframes, event_time_indices, event_return_codes):

  • event_tsframes::Vector{TSFrame}: a vector of TSFrames, one per successful event.
  • event_time_indices::Vector{Int}: the (integer) indices in timeseries of the events.
  • event_return_codes::Vector{EventStatus}: the status of each event. This is a vector of EventStudies.EventStatus objects, of the same length as the input event_times.
source

Event codes

Each event has an associated event time. If the time is not viable to study (outside the index of the input data), or there is some issue with either the data or the model, then the event will be ignored.

Ignored events have an event code which describes why they were ignored; successful events have the code EventStudies.Success.