View source: R/downscale_control.R
downscale_control | R Documentation |
This function configures the downscalR solver with customizable options. It allows the selection of the solver function and adjustment of solver behavior and stopping conditions, tailored for specific downscaling needs.
downscale_control(
solve_fun = "solve_biascorr",
algorithm = "NLOPT_LN_SBPLX",
xtol_rel = 1e-20,
xtol_abs = 1e-20,
maxeval = 1600,
MAX_EXP = log(.Machine$double.xmax),
cutoff = 0,
max_diff = 1e-08,
ref_class_adjust_threshold = 1e-08,
err.txt = ""
)
solve_fun |
The downscaling function to use. Valid options are " |
algorithm |
Specifies the solver algorithm. The default algorithm is " |
xtol_rel |
The relative tolerance level of the solver, controlling solution precision in relative terms. Default is |
xtol_abs |
The absolute tolerance level of the solver, specifying solution precision in absolute terms. Default is |
maxeval |
The maximum number of evaluations the solver will perform, limiting computational effort. Default is |
MAX_EXP |
Sets the numerical cutoff to prevent extremely high values in the Multinomial Logit (MNL) function. Default is |
cutoff |
An optional cutoff in the share of a pixel to avoid MNL values close to zero. Default is |
max_diff |
The threshold for acceptable difference to targets. If exceeded, the estimation is redone. Default is |
ref_class_adjust_threshold |
The threshold for adjusting the reference class in the MNL. If the implied target share for the reference class is below this, additional areas are created for numerical stability and removed after solving. Default is |
err.txt |
An optional error message for debugging purposes. Empty by default. |
The function returns a list of parameters to be used by the solver. It is essential to provide compatible parameters to ensure accurate downscaling results. The function will stop with an error message if solve_fun
is not correctly specified.
Returns a list with the specified options for the downscaling solver.
# Default settings
opts_default = downscale_control()
# Custom settings
opts_custom = downscale_control(algorithm = "some_other_algorithm",
xtol_rel = 1e-5, xtol_abs = 1e-5,
maxeval = 2000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.