Learn R Programming

echoice2 (version 0.2.4)

ec_gen_err_ev1: Simulate error realization from EV1 distribution

Description

Simulate error realization from EV1 distribution

Usage

ec_gen_err_ev1(ec_dem, draws, seed = NULL)

Value

error realizations

Arguments

ec_dem

discrete or volumetric choice data, with or without x

draws

draws from volumetric demand model

seed

seed for reproducible error realisations; seet is automatically reset of running this function

Examples

Run this code
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=100, keep=1, cores=2)
#generate error realizations
errs<- ec_gen_err_ev1(icecream %>% dplyr::filter(id<100), icecream_est, seed=123)

Run the code above in your browser using DataLab