//---------------------------------------------------------------------- void BLCSSS::draw(){ enum SamplingMethod { DATA_AUGMENTATION = 0, RWM = 1, TIM = 2 }; SamplingMethod method = SamplingMethod(rmulti_mt(rng(), sampler_weights_)); switch (method) { case DATA_AUGMENTATION: { MoveTimer timer = move_accounting_.start_time("auxmix"); BinomialLogitSpikeSlabSampler::draw(); move_accounting_.record_acceptance("auxmix"); break; } case RWM: { MoveTimer timer = move_accounting_.start_time("rwm (total time)"); rwm_draw(); break; } case TIM: { MoveTimer timer = move_accounting_.start_time("TIM (total time)"); tim_draw(); break; } default: report_error("Unknown method in BinomialLogitSpikeSlabSampler::draw."); } // switch }
//---------------------------------------------------------------------- void BLCSSS::draw(){ double u = runif_mt(rng()); clock_t start = clock(); if(u < .333){ ++auxmix_tries_; BinomialLogitSpikeSlabSampler::draw(); clock_t end = clock(); auxmix_times_ += double(end - start) / CLOCKS_PER_SEC; }else if(u < .6667){ ++rwm_tries_; rwm_draw(); clock_t end = clock(); rwm_times_ += double(end - start) / CLOCKS_PER_SEC; }else{ ++tim_tries_; tim_draw(); clock_t end = clock(); tim_times_ += double (end - start) / CLOCKS_PER_SEC; } }