trunc_gamma_para {DTEBOP2}R Documentation

Estimate Shape and Scale Parameters for Truncated Gamma Distribution

Description

This function estimates the shape and scale parameters of a truncated Gamma distribution based on expert-provided summary statistics, including the mean, median, standard deviation, and selected quantiles. Parameter estimation is performed using a grid search combined with weighted least squares optimization. Parallel computing is employed to accelerate the estimation process.

Usage

trunc_gamma_para(
  L,
  U,
  expert_data,
  weights = c(10, 10, 2, 1, 1),
  num_cores = 4,
  seed = NULL
)

Arguments

L

Numeric. Lower bound of the truncated Gamma distribution.

U

Numeric. Upper bound of the truncated Gamma distribution.

expert_data

A list of named lists, where each inner list represents one expert's input. Each expert can provide any subset of the following named elements:

mean

Numeric. The expected mean of the distribution.

median

Numeric. The expected median of the distribution.

sd

Numeric. The expected standard deviation of the distribution.

q25

Numeric. The 2.5th percentile.

q975

Numeric. The 97.5th percentile.

weights

Numeric vector of length 5. Specifies the relative importance of each summary statistic in the optimization procedure. The order corresponds to: c(mean, median, sd, q25, q975). Default is c(10, 10, 2, 1, 1).

num_cores

Integer. Number of CPU cores to use for parallel computation. Default is 4.

seed

Optional integer. If provided, sets the seed for reproducibility.

Value

A list with the following components:

shape

Numeric. Estimated shape parameter of the Gamma distribution.

scale

Numeric. Estimated scale parameter of the Gamma distribution.

Examples

# Define expert-provided summary data
expert_data_correct <- list(
  list(mean = 2.2, median = 2.27, sd = NULL, q25 = NULL, q975 = NULL),  # Expert A
  list(mean = 2.1, median = 2.3,  sd = NULL, q25 = NULL, q975 = NULL),  # Expert B
  list(mean = NULL, median = 2.31, sd = NULL, q25 = NULL, q975 = NULL)  # Expert C
)

  # Estimate parameters using truncated gamma prior
  trunc_gamma_para(L = 2,U = 2.5,expert_data = expert_data_correct,num_cores = 4)


[Package DTEBOP2 version 1.0.3 Index]