Learn R Programming

denim (version 1.2.1)

nonparametric: Nonparametric distribution

Description

Convert a vector of frequencies, percentages... into a distribution

Usage

nonparametric(x, dist_init = FALSE)

Value

a Distribution object for simulator

Arguments

x

a vector of values

dist_init

whether to distribute initial value across subcompartments following this distribution. (default to FALSE, meaning init value is always in the first compartment))

Examples

Run this code
transitions <- list("S->I"=nonparametric( c(0.1, 0.2, 0.5, 0.2) ))
transitions <- denim_dsl({S->I=nonparametric( c(0.1, 0.2, 0.5, 0.2) )})
# you can also define a model parameter for the distribution
transitions <- denim_dsl({S->I=nonparametric( dwelltime_dist )})

Run the code above in your browser using DataLab