Adds summaries of posterior draws of demand to tibble. (using the new demand draw format)

ec_dem_summarise(de,quantiles)

ec_dem_summarize(de, quantiles = c(0.05, 0.95))

Arguments

de

demand draws

quantiles

Quantiles for Credibility Intervals (default: 90% interval)

Value

Summary of demand predictions

Examples

# \donttest{
data(icecream)
#run MCMC sampler (use way more than 10 draws for actual use)
icecream_est <- icecream %>% dplyr::filter(id<10) %>% vd_est_vdm(R=10, keep=1)
#> Using 16 cores
#>  MCMC in progress 
#> MCMC complete
#>  Total Time Elapsed: 0.00 minutes
#Generate demand predictions
icecream_predicted_demand=
 icecream %>% dplyr::filter(id<10) %>%   
   vd_dem_vdm(icecream_est)
#> Using 16 cores
#aggregate
brand_lvl_pred_demand <-
 icecream_predicted_demand %>% ec_dem_aggregate("Brand")
#summarise
brand_lvl_pred_demand %>% ec_dem_summarise()
#> # A tibble: 7 × 6
#>   Brand     .demdraws  `E(demand)` `S(demand)` `CI-5%` `CI-95%`
#>   <fct>     <list>           <dbl>       <dbl>   <dbl>    <dbl>
#> 1 BenNJerry <dbl [10]>       119.         22.3    91.3     152.
#> 2 BlueBell  <dbl [10]>       133.         27.9    86.4     162.
#> 3 BlueBunny <dbl [10]>        95.5        30.1    52.4     134.
#> 4 Breyers   <dbl [10]>       112.         25.2    77.5     147.
#> 5 Dryers    <dbl [10]>        99.5        27.8    67.4     137.
#> 6 HaagenDa  <dbl [10]>       128.         25.6    92.1     168.
#> 7 Store     <dbl [10]>       119.         15.5   103.      142.
# }