Event-class: A Reference Class to represent an event with start and end...

Description Fields Methods

Description

A Reference Class to represent an event with start and end date and how it varies in time.

Fields

start

A date string of the form "YYYY-MM-DD" or vector of date strings if the event has more than one start date.

end

A date string of the form "YYYY-MM-DD" or vector of date strings if the event has more than one end date.

time_function

A string naming the type of time function. ("none", "linear", "inverse"): "none" generates an indicator variable that is 1 between the endpoints (inclusive) and 0 otherwise. "linear" generates a continuous variable that starts at 1 on the start day and is incremented by one every subsiquent day and is zero outside start and end days. "inverse" generates a continuous variable that is starts at 1 on the start day and decrements as a function of 1/(1+days past start) and is zero outside start and end.

Methods

initialize(..., start = "0001-01-01", end = "9999-01-01", time_function = "none")

Makes default event very long, to ease creation of single bounded event. Call Event() then set start or end date

regressor(dates)

Create event regressor over a sequence of dates.


wjhrdy/foregen documentation built on May 4, 2019, 7:33 a.m.