LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
sim_quest_heuristic_ci.h File Reference

Fallback interval used when a QUEST stage test fails. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <vector>
#include "line/api/sim/sim_dist.h"
#include "line/api/sim/sim_types.h"
#include "line/num/number.h"
#include "line/util/error.h"
Include dependency graph for sim_quest_heuristic_ci.h:

Go to the source code of this file.

Classes

struct  line::sim::QuestInterval< T >
 A confidence interval, asymmetric about the point estimate in general. More...

Namespaces

namespace  line
namespace  line::sim

Functions

template<class T>
QuestInterval< T > line::sim::sim_quest_heuristic_ci (const std::vector< T > &bqe, const T &centre, const T &Ap, const T &Np, std::size_t nstar, double alpha, bool useAutocorr)
 Fallback interval used when a QUEST stage test fails.

Detailed Description

Fallback interval used when a QUEST stage test fails.

Port of matlab/src/api/sim/sim_quest_heuristic_ci.m. Three intervals are formed and the smallest interval containing all of them is returned, which is the article's prescription:

Two symmetric intervals of half-width h = max(t_{1-alpha/2,K} sqrt(Ap/nstar), t_{1-alpha/2,K-1} sqrt(Np/nstar)), one about the full-sample quantile and one about the average of the batched quantile estimators. Taking the WIDER of the two variance components is deliberately conservative: a stage test has just failed, so neither component can be trusted.

Willink's asymmetric interval, which corrects the batched quantile estimators for skewness through the cube-root transform G(zeta) = ([1+6 gamma(zeta-gamma)]^(1/3)-1)/(2 gamma) with gamma = skewness/(6 sqrt(K)), evaluated at both t-quantiles so the two arms differ.

useAutocorr additionally scales the asymmetric arms by max(sqrt((1+phi1)/(1-phi1)), 1), with phi1 the lag-1 autocorrelation of the batch quantiles. It is true for sim_fquest, where they come from one sample path and can stay correlated, and false for sim_firquest, where they come from independent replications and the article drops the correction.

Np ARRIVES AS NaN when the caller had a single batch per path. The reference relies on MATLAB's max() omitting NaN, so the interval then rests on the Ap component alone; the max here omits NaN explicitly for the same reason, since a C++ comparison against NaN is false in both directions and the naive form would propagate the NaN into the delivered endpoints.

Reference: R. Willink, "A Confidence Interval and Test for the Mean of an Asymmetric Distribution", Commun. Statist. Theory Methods 34, 2005; A. Lolos et al., Proc. Winter Simulation Conference, 2023, step 10, and Proc. Winter Simulation Conference, 2025, equations 8 to 10.

Definition in file sim_quest_heuristic_ci.h.