Sample from a normal distribution given predictions and variance
Source:R/sample_methods.R
sample_normal.RdGenerates samples from a normal distribution with the given predictions
as means and the estimated variance, rounded to integers for use with
count data. This is the sampling counterpart to fit_normal().
See also
Other sample_distribution:
sample_skellam()
Examples
pred <- c(3.2, 4.6, 5.1)
variance <- 2.5
samples <- sample_normal(pred, uncertainty_params = variance)
samples
#> [1] 1 5 1