ec_dem_eval {echoice2}R Documentation

Evaluate (hold-out) demand predictions

Description

This function obtains proper posterior fit statistics. It computes the difference between true demand and each draw from the demand posterior. Then, fit statistics are obtained.

Usage

ec_dem_eval(de)

Arguments

de

demand draws (output from vd_dem_x function)

Value

Predictive fit statistics (MAE, MSE, RAE, bias, hit-probability)

data(icecream) #run MCMC sampler (use way more than 50 draws for actual use) icecream_est <- icecream %>% dplyr::filter(id<100) %>% vd_est_vdm(R=20, keep=1, cores=2) #Generate demand predictions icecream_predicted_demand= icecream %>% dplyr::filter(id<100) %>% vd_dem_vdm(icecream_est) #evaluate in-sample fit (note: too few draws for good results) ec_dem_eval(icecream_predicted_demand)


[Package echoice2 version 0.2.4 Index]