This is a helper function to quickly obtain log marginal density from a draw object

ec_lmd_NR(est)

Arguments

est

'echoice2' draw object

Value

tibble with LMDs (first 25% of draws, next 25% of draws, ...)

Details

Draws are split in 4 equal parts from start to finish, and LMD is computed for each part. This helps to double-check convergence.

Examples

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=50)
#> Using 16 cores
#>  MCMC in progress 
#> MCMC complete
#>  Total Time Elapsed: 0.00 minutes
#obtain LMD by quartile of draws
ec_lmd_NR(icecream_est)
#> # A tibble: 4 × 2
#>    part     lmd
#>   <dbl>   <dbl>
#> 1  0.25   -Inf 
#> 2  0.5  -25816.
#> 3  0.75 -21965.
#> 4  1    -19866.