Run likelihood profile for a FIMS model
run_fims_likelihood.RdThis function runs a likelihood profile for a FIMS model by fixing a specified parameter at a range of values spanning the initial value.
Usage
run_fims_likelihood(
model,
parameters,
data,
module_name = NULL,
parameter_name = "log_rzero",
n_cores = NULL,
min = -2,
max = 2,
length = 5
)Arguments
- model
Output from
estimate_fims(), currently only used to get the estimated value for log_rzero.- parameters
A FIMS parameters object containing the model parameters.
- data
A dataframe or tibble containing the model data, or a FIMSFrame object.
- parameter_name
A string specifying the parameter to profile over, e.g., "log_rzero".
- n_cores
The number of cores to use to run likelihood profile in parallel. Default is
parallel::detectCores() - 1.- min
The minimum value for the parameter profile relative to the initial value.
- max
The maximum value for the parameter profile relative to the initial value.
- length
The number of values to generate between
minandmax. An odd number is recommended to include the initial value.
Value
A list containing the vector of parameter values and a dataframe with the estimates for each model.
Examples
if (FALSE) { # \dontrun{
library(FIMS)
# Use built-in dataset from FIMS
data("data1")
data_4_model <- FIMSFrame(data1)
# Create a parameters object
parameters <- data_4_model |>
create_default_configurations() |>
create_default_parameters(data = data_4_model)
# Run the model with optimization
base_model <- parameters |>
initialize_fims(data = data_4_model) |>
fit_fims(optimize = TRUE)
like_fit <- run_fims_likelihood(
model = base_model,
parameters = parameters,
parameter_name = "log_rzero",
data = data1,
n_cores = 3,
min = -1,
max = 1,
length = 3
)
} # }