Learn R Programming

baselinenowcast (version 0.2.0)

sample_nb: Sample from negative binomial model given a set of predictions

Description

Sample from negative binomial model given a set of predictions

Usage

sample_nb(pred, uncertainty_params)

Value

sampled_pred Object of the same dimensions as pred representing a single draw from the negative binomial distribution with the specified uncertainty params.

Arguments

pred

Vector of predictions.

uncertainty_params

Vector of uncertainty parameters.

See Also

Probabilistic nowcast generation functions combine_obs_with_pred(), sample_nowcast(), sample_nowcasts(), sample_prediction(), sample_predictions()

Examples

Run this code
pred <- c(3.2, 4.6)
sampled_preds <- sample_nb(pred,
  uncertainty_params = c(50, 100)
)
sampled_preds

Run the code above in your browser using DataLab