Closed pehkawn closed 4 months ago
@perrydv It seems reasonable to add this buildDerivs
argument to readBUGSmodel
.
I'd be happy to make this quick change, but let me know what you think.
@danielturek @perrydv looks like we never resolved this. I'm going to add the argument to readBUGSmodel
unless there are objections.
@paciorek Agreed, thank you.
According to the Nimble user guide, automatic differentiation (AD) is needed when using HMC (
nimbleHMC::nimbleHMC()
).When building a model using
nimbleModel()
, AD can be enabled by setting the function argumentbuildDerivs = TRUE
. However, when building the model usingreadBUGSmodel()
, there's seemingly no option for enabling AD.Consequentially, I get the error message:
when running
nimbleHMC()
on my BUGS model.~I was therefore wondering if there's another way of enabling AD, when reading in a BUGS model file?~
As a feature suggestion, it would be an improvement if
buildDerivs
were to be added to available options in eithernimbleHMC()
orreadBUGSmodel()
.[Edit:]
I just realized I can enable AD for all models by setting
nimbleOptions(buildModelDerivs = TRUE)
. However, I do not know the implications of having AD globally enabled. Still, it would be a nice feature to enable AD for the model only.