Utility function that checks whether a user input is a valid delay object. This means it can be one of the following:

  • a probability distribution vector: a numeric vector with no NA or negative values, whose entries sum up to 1

  • an empirical delay data: a data frame with two columns: event_date and report_delay. The columns cannot contain NA values. report_delay only contains non-negative values

  • a delay distribution matrix (as described in .check_is_delay_distribution_matrix)

  • a distribution object (e.g. list(name = 'gamma', scale = X, shape = Y))

.is_valid_delay_object(delay_object, parameter_name, incidence_data_length)

Arguments

delay_object

user inputted object to be tested

parameter_name

A string containing the name the tested parameter had in the initial function in which it was passed.

incidence_data_length

A number representing the length of the given incidence data.

Value

TRUE if all tests were passed. Throws an error otherwise.