
Build or access an Opal runtime objective
opal_build.Rdopal_build() resolves omitted parameters, maps, and bounds, then checks
that the initial objective and gradient are finite. It does not optimise.
opal_fit() and opal_mcmc() call it automatically.
Value
opal_build() returns the updated object; opal_rtmb() returns a
transient RTMB objective. Use fresh = TRUE for isolated mutable work.
Details
Call opal_build() before requesting the runtime of an unresolved object.
Use opal_rtmb(assessment, fresh = TRUE) for external optimisation,
simulation, profiling, or other work that mutates RTMB state. The runtime is
transient; save the assessment with opal_save(), not the RTMB object.
See also
Other assessment workflow:
opal_attach_fit(),
opal_attach_mcmc(),
opal_check(),
opal_derived(),
opal_example_inputs(),
opal_fit(),
opal_from_fit(),
opal_io,
opal_mcmc(),
opal_obj(),
opal_posterior(),
opal_project(),
opal_report(),
opal_update()
Examples
inputs <- opaka_quickstart_inputs()
assessment <- opal_build(opal_obj(inputs$data, inputs$parameters, inputs$map))
runtime <- opal_rtmb(assessment, fresh = TRUE)
runtime$fn(runtime$par)
#> [1] 67665.47