compute_wls_error {DTEBOP2}R Documentation

Compute Weighted Least Squares Error (Internal)

Description

This function calculates the weighted least squares (WLS) error between simulated truncated Gamma samples and expert-provided statistics. It is used internally by trunc_gamma_para() and is not intended for direct user access.

Usage

compute_wls_error(sim_data, expert_values, weights)

Arguments

sim_data

Numeric vector. A sample of simulated truncated Gamma values.

expert_values

Named list. A list containing expert-provided statistics, including mean, median, sd, q25, and q975. Some values may be NULL.

weights

Numeric vector. A vector of weights for the WLS calculation, corresponding to the importance of c(mean, median, sd, q25, q975).

Value

Numeric. The weighted least squares error.


[Package DTEBOP2 version 1.0.3 Index]