Generic used by the IES driver so a caller can pass either a bare
function(theta) -> obs or a fully-specified pesto_forward_model().
A bare function is wrapped with the supplied policy arguments; an
existing pesto_forward_model is returned unchanged (its own policy
is authoritative and the ... are ignored).
Arguments
- x
A function or a
pesto_forward_model.- ...
Policy arguments forwarded to
pesto_forward_model()whenxis a bare function (e.g.on_failure,parallel,n_obs).
Examples
fm <- as_forward_model(function(theta) theta, on_failure = "stop")
S7::S7_inherits(fm, pesto_forward_model)
#> [1] TRUE