
Extract Parameters and Optimization Details with Log-Likelihood
extract_age_param.Rd
Reads files matching the pattern "age_param_spatial_urban" in a specified directory, extracts the country name, parameter values, and optimization details, combines the results into a data frame, and optionally saves the output to a file.
Examples
# \donttest{
# Create temporary directory for dummy parameter files
dummy_dir <- tempdir()
dummy_params <- list(
par = c(0.5, 1.2, 0.8, log(2), log(3), log(4)),
objective = -123.45,
convergence = 0,
iterations = 10,
evaluations = c("function = 20, gradient = 15"),
message = "Converged"
)
saveRDS(dummy_params, file = file.path(dummy_dir,
"abc_age_param_spatial_urban.rds"))
params_df <- extract_age_param(dir_path = dummy_dir,
output_file = tempdir())
#> ✔ Model paramters extracted and saved to /tmp/RtmpioKZmp.
# }