ec_dem_aggregate {echoice2} | R Documentation |
Aggregate posterior draws of demand
Description
Aggregate demand draws, e.g. from individual-choice occasion-alternative level to individual level. (using the new demand draw format)
Usage
ec_dem_aggregate(de,groupby)
Arguments
de |
demand draws |
groupby |
groupby grouping variables (as (vector of) string(s)) |
Value
Aggregated demand predictions
Examples
data(icecream)
#run MCMC sampler (use way more than 50 draws for actual use)
icecream_est <- icecream %>% dplyr::filter(id<10) %>% vd_est_vdm(R=4, keep=1, cores=2)
#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")
[Package echoice2 version 0.2.4 Index]