As a backup, I copied the local files of a project to One Drive, including the Rdata file containing all objects from previous Stan optimizations. When trying to access the output of one of these objects (e.g., $summary(), $lp()) ~on a different computer~, I wasn’t able. I keep receiving the following error:
Error in maybe_convert_draws_format(private$draws_, format) :
could not find function "maybe_convert_draws_format"
Sounds like a problem with the libraries. However, when executing a new optimization, I was able to obtain those results, no problem. In addition, I’m able to access the $time() function of all old runs.
I’m able to View the elements in the old runs environments. The first difference I noticed between old (unable to retrieve results) and new (able to retrieve results) runs is in the [[“hessian”]] and [[“grad_log_prob”]] functions.
This is how it looks when I’m able to get results:
function (unconstrained_variables, jacobian = TRUE, jacobian_adjustment = NULL)
{
if (!is.null(jacobian_adjustment)) {
warning("'jacobian_adjustment' is deprecated. Please use 'jacobian' instead.",
call. = FALSE)
jacobian <- jacobian_adjustment
}
if (is.null(private$model_methods_env_$model_ptr)) {
stop("The method has not been compiled, please call `init_model_methods()` first",
call. = FALSE)
}
if (length(unconstrained_variables) != private$model_methods_env_$num_upars_) {
stop("Model has ", private$model_methods_env_$num_upars_,
" unconstrained parameter(s), but ", length(unconstrained_variables),
" were provided!", call. = FALSE)
}
private$model_methods_env_$hessian(private$model_methods_env_$model_ptr_,
unconstrained_variables, jacobian)
}
And this is how it looks when I’m not:
function (unconstrained_variables, jacobian_adjustment = TRUE)
{
if (is.null(private$model_methods_env_$model_ptr)) {
stop("The method has not been compiled, please call `init_model_methods()` first",
call. = FALSE)
}
if (length(unconstrained_variables) != private$model_methods_env_$num_upars_) {
stop("Model has ", private$model_methods_env_$num_upars_,
" unconstrained parameter(s), but ", length(unconstrained_variables),
" were provided!", call. = FALSE)
}
private$model_methods_env_$hessian(private$model_methods_env_$model_ptr_,
unconstrained_variables, jacobian_adjustment)
}
I’m not sure if this is the crux of the issue. But I know any changes in the objects and their elements occurred when trying to open the new results from One Drive on a different computer.
Any insights will be much appreciated. To complicate things further, I no longer have the original Rdata file, but only the backup I copied in OneDrive.