The srbeta_optimize() function generates an optimized proposal for a targeted Beta distribution.
The proposal can be customized and adjusted based on various options provided by the user.
srbeta_optimize(
shape1 = 2,
shape2 = 2,
xl = 0,
xr = 1,
steps = NULL,
proposal_range = NULL,
theta = 0.1,
target_sample_size = 1000,
verbose = FALSE
)A list containing the optimized proposal and related parameters for the specified Beta distribution. The proposal is also cached for internal use.
dataDetailed information about the proposal steps, including x, s_upper, p_a, and s_upper_lower.
areasThe areas under the left tail, steps, and right tail of the proposal distribution.
steps_numberThe number of steps in the proposal.
f_paramsThe parameters (shape1 and shape2) of the Beta distribution.
(optional) Numeric. The first shape parameter (\(\alpha\)) of the Beta distribution. Defaults to 1.
(optional) Numeric. The second shape parameter (\(\beta\)) of the Beta distribution. Defaults to 1.
Numeric. Left truncation bound for the target distribution. Defaults to 0, as the Beta distribution is defined only on the interval [0, 1].
Numeric. Right truncation bound for the target distribution. Defaults to 1, as the Beta distribution is defined only on the interval [0, 1].
(optional) Integer. Desired number of steps in the proposal. Defaults to 4091.
(optional) Numeric vector. Specifies the range for optimizing the steps part of the proposal. Defaults to NULL, indicating automatic range selection.
Numeric. A parameter for proposal optimization. Defaults to 0.1.
(optional) Integer. Target sample size for proposal optimization. Defaults to 1000.
Boolean. If TRUE, detailed optimization information, including areas and steps, will be displayed. Defaults to FALSE.
When srbeta_optimize() is explicitly called:
A proposal is created and cached. If no parameters are provided, a standard proposal is created with shape1 = 1 and shape2 = 1.
Providing shape1 and shape2 creates a custom proposal, which is cached for use with srbeta_custom().
The optimization process can be controlled via parameters such as steps, proposal_range, or
theta. If no parameters are provided, the proposal is optimized via brute force based on the
target_sample_size.
srbeta_custom: Function to sample from a custom proposal generated by srbeta_optimize().
# Generate a standard proposal with shape1 = 1 and shape2 = 1
standard_proposal <- srbeta_optimize()
# Generate a custom proposal with shape1 = 2 and shape2 = 3
custom_proposal <- srbeta_optimize(shape1 = 2, shape2 = 3)
Run the code above in your browser using DataLab