dot-is_valid_distribution: Check if valid distribution list

.is_valid_distributionR Documentation

Check if valid distribution list

Description

Check if valid distribution list

Usage

.is_valid_distribution(
  distribution,
  parameter_name = deparse(substitute(distribution))
)

Arguments

distribution

list. probability distribution specified in list format e.g. list(name = "gamma", shape = 2, scale = 4). The distribution list must contain a 'name' element, this element must be a string and correspond to one of the types of distributions supported in the Distributions package. distribution must also contain parameters for the specified distribution, in the form 'parameter_name=parameter_value'.

parameter_name

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

Value

boolean. Returns FALSE if parameter values return an improper distribution (if gamma distr). Throws an error if not a list, or not a list with the appropriate elements. Returns TRUE otherwise.


covid-19-Re/estimateR documentation built on Sept. 14, 2024, 5:49 a.m.