set_timestamps.Rd
This function adds dummy columns for weekdays (named Sunday
, Monday
, Tuesday
, Wednesday
, Thursday
, Friday
and Saturday
) and day parts (morning
, afternoon
) to the given subset of the specified data set. These are used by var_main
to find better models by removing cyclicity from the data set.
set_timestamps(av_state, subset_id = 1, date_of_first_measurement, measurements_per_day = 1, log_level = 0, first_measurement_index = 1, add_days_as_exogenous = TRUE, add_dayparts_as_exogenous = TRUE, add_weekend_as_exogenous = FALSE)
av_state | an object of class |
---|---|
subset_id | either an integer subset index or the the value for the |
date_of_first_measurement | the date of the first measurement. This argument should be given in the format: |
measurements_per_day | how many measurements were taken per day. This default is 1. It is assumed that every day has exactly this amount of measurements, and that the first measurement in the dataset was the first measurement on that day. |
log_level | sets the minimum level of output that should be shown (a number between 0 and 3). A lower level means more verbosity. Specify a log_level of 3 to hide messages about the exogenous columns being added. |
first_measurement_index | is used to specify that the first day of measurements has fewer than |
add_days_as_exogenous | adds days as exogenous dummy variables to VAR models. |
add_dayparts_as_exogenous | adds day parts as exogenous dummy variables to VAR models. |
add_weekend_as_exogenous | adds one exogenous variable named |
This function returns the modified av_state
object.
# NOT RUN { av_state <- load_file("../data/input/pp4 nieuw compleet met 140min.sav",log_level=3) av_state <- set_timestamps(av_state,date_of_first_measurement="2010-04-14") # an example with multiple measurements per day: av_state <- load_file("../data/input/ID68 basisbestand.sav",log_level=3) av_state <- set_timestamps(av_state,date_of_first_measurement="2012-07-12", measurements_per_day=3) # same data set, but one extra day because the first day only has one measurement av_state <- load_file("../data/input/ID68 basisbestand.sav",log_level=3) av_state <- set_timestamps(av_state,date_of_first_measurement="2012-07-12", measurements_per_day=3,first_measurement_index=3) # }