Compile (once) and run a NIMBLE MCMC configured in conf, with
per-sampler timing enabled, then return the vector of times (seconds) for
each sampler defined in conf. A small in-session cache can be added
by the caller if desired, but this function itself performs no caching.
Arguments
- conf
A NIMBLE MCMC configuration object (for example returned by
nimble::configureMCMC(model)).- cmodel
A compiled
nimbleModelused asproject =fornimble::compileNimble().- niter
Integer scalar; number of MCMC iterations to run for profiling. Default
5e4.
Value
A numeric vector of length equal to the number of samplers in
conf, giving the per-sampler elapsed time (in seconds). If NIMBLE
reports fewer or more entries than samplers, the vector is padded or
truncated accordingly with NAs.
Examples
if (FALSE) { # \dontrun{
model <- nimbleModel(code, constants = Const, data = Data, inits = Inits)
cmodel <- compileNimble(model)
conf <- configureMCMC(model)
ts <- profile_sampler_times(conf, cmodel, niter = 1e4)
print(ts)
} # }