data(small_example_data)
# Build time using a single delta (so data has time,x,y)
small_txy <- small_example_data %>%
dplyr::mutate(time = power_law_mapping(size, 0.5)) %>%
dplyr::select(time, x, y)
x_grid <- seq(0, 25, length.out = 5)
y_grid <- seq(0, 25, length.out = 5)
t_grid <- seq(0, 1, length.out = 5)
parameter_inits <- c(1.5, 8.5, .015, 1.5, 3.2, .75, 3, .08)
upper_bounds <- c(1, 25, 25)
fit <- estimate_process_parameters(
data = small_txy,
process = "self_correcting",
x_grid = x_grid,
y_grid = y_grid,
t_grid = t_grid,
upper_bounds = upper_bounds,
parameter_inits = parameter_inits,
strategy = "global_local",
global_algorithm = "NLOPT_GN_CRS2_LM",
local_algorithm = "NLOPT_LN_BOBYQA",
global_options = list(maxeval = 150),
local_options = list(maxeval = 25, xtol_rel = 1e-2),
verbose = TRUE
)
coef(fit)
logLik(fit)
# \donttest{
# Delta-search example (data has x,y,size; time is derived internally for each delta)
fit_delta <- estimate_process_parameters(
data = small_example_data, # x,y,size
process = "self_correcting",
x_grid = x_grid,
y_grid = y_grid,
t_grid = t_grid,
upper_bounds = upper_bounds,
parameter_inits = parameter_inits,
delta_values = c(0.35, 0.5, 0.65, 0.9, 1.0),
parallel = TRUE,
set_future_plan = TRUE,
num_cores = 2,
strategy = "multires_global_local",
global_options = list(maxeval = 100),
local_options = list(maxeval = 100, xtol_rel = 1e-3),
n_starts = 3,
refine_best_delta = TRUE,
verbose = TRUE
)
plot(fit_delta)
# }
Run the code above in your browser using DataLab