Learn R Programming

echoice2 (version 0.2.3)

vd_dem_summarise: Summarize posterior draws of demand (volumetric models only)

Description

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

Usage

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

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

Value

Summary of demand predictions

Arguments

de

demand draws

quantiles

Quantiles for Credibility Intervals (default: 90% interval)

Examples

Run this code
# \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)
#Generate demand predictions
icecream_predicted_demand=
 icecream %>% dplyr::filter(id<10) %>%   
   vd_dem_vdm(icecream_est)
#aggregate
brand_lvl_pred_demand <-
 icecream_predicted_demand %>% ec_dem_aggregate("Brand")
#summarise
brand_lvl_pred_demand %>% vd_dem_summarise()
# }

Run the code above in your browser using DataLab