Upgrade a saved fit object to the current BayesRTMB class definitions
Source:R/upgrade_fit.R
upgrade_fit.Rd`upgrade_fit()` rebuilds an existing fit object with the currently loaded BayesRTMB R6 class definitions. This is useful for saved fit objects created by older package versions when newer methods have been added to the fit classes.
Details
The function does not refit the model or recompute estimates. It only copies the stored estimation results into a new fit object. When `upgrade_model` is `TRUE`, the embedded `RTMB_Model` object is also rebuilt from the model components stored in the fit, so newer model methods are available as well.