compute_wls_error: Compute Weighted Least Squares Error (Internal)

View source: R/compute_wls_error.R

compute_wls_errorR 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.


DTEBOP2 documentation built on June 8, 2025, 1:24 p.m.