Skip to contents

Attach a result from an external optimiser to the configuration that produced it. The objective, parameter layout, and bounds are verified before retaining the point. For ordinary optimisation, use opal_fit().

Usage

opal_attach_fit(x, opt, check = TRUE, check_args = list())

Arguments

x

A configured opal_obj.

opt

Optimiser result with named par, objective, and convergence.

check

Run fitting diagnostics after attachment.

check_args

Named arguments passed to opal_check().

Value

A fitted opal_obj.

Examples

assessment <- opal_read(system.file("extdata", "opaka_quickstart_fit.rds",
                                   package = "opal"))
#> Warning: The saved fit runtime identity differs because it was serialized under a different R version; verifying by rebuild.
#> Warning: The saved fit runtime identity differs because it was serialized under a different R version; verifying by rebuild.
#> Warning: The opal_model implementation checksum differs from the saved fit. The saved fit used opal 0.0.4; the current version is 0.1.1.
# Reattach the already verified optimum; no optimisation is performed.
assessment <- opal_attach_fit(assessment, assessment$fit$opt, check = FALSE)
#> Warning: The model implementation checksum differs from the saved object.
#> Warning: The model implementation checksum differs from the saved object.
#> Warning: The model implementation checksum differs from the saved object.