![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Fixed-sample-size quantile interval from independent replications. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <string>#include <vector>#include "line/api/sim/sim_dist.h"#include "line/api/sim/sim_fquest.h"#include "line/api/sim/sim_quest_heuristic_ci.h"#include "line/api/sim/sim_quest_options.h"#include "line/api/sim/sim_shapirowilk.h"#include "line/api/sim/sim_sts_quantile_areas.h"#include "line/api/sim/sim_types.h"#include "line/api/sim/sim_vonneumann.h"#include "line/num/number.h"#include "line/util/error.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| namespace | line::sim |
Functions | |
| std::vector< long > | line::sim::sim_firquest_batchcounts (std::size_t R) |
| The article's batch counts as a function of the replication count, chosen so that R*b pooled statistics remain enough to test while every replication still contributes at least one batch. | |
| QuestOptions | line::sim::sim_firquest_options (std::size_t R) |
| The FIRQUEST defaults at R replications: b0 = 25 and the R-dependent ladder, every other constant as in FQUEST. | |
| template<class T> | |
| QuestResult< T > | line::sim::sim_firquest (const std::vector< std::vector< T > > &Y, double p, double alpha=0.05, const QuestOptions *options=nullptr) |
| Fixed-sample-size quantile interval from independent replications. | |
Fixed-sample-size quantile interval from independent replications.
Port of matlab/src/api/sim/sim_firquest.m. FIRQUEST is the replicated counterpart of FQUEST and differs from sim_fquest in four places:
The warmup randomness test runs independently on each replicate path, and the batch size it settles on may differ between replications.
Truncation removes the LARGEST of those batch sizes from the front of every replication, not just from one path. This is more aggressive than FQUEST on purpose: an untruncated transient common to all replications biases every replicate estimate the same way, and averaging cannot remove it.
The four stage tests act on the R*b signed areas and R*b replicate batched quantile estimators POOLED IN REPLICATION-MAJOR ORDER, i.e. all b statistics of replication 1, then those of replication 2, and so on, which is MATLAB's column-major areas(:). Both stage tests are order-sensitive, so pooling in any other order silently changes which batch count is selected.
The delivered interval is ytilde_p(N*) +- t_{1-alpha/2, 2Rb-1} sqrt(Vtilde_p(w;R,b,m)/N*), N* = R*b*m, with the pooled combined variance-parameter estimator A_p(w;R,b,m) = (Rb)^{-1} sum_j A_p(w;j,m)^2 Ntilde_p(R,b,m) = m (Rb-1)^{-1} sum_j (yhat_p(j,m) - ytilde_p(N*))^2 Vtilde_p = [Rb A_p + (Rb-1) Ntilde_p] / (2Rb-1). The heuristic fallback drops FQUEST's residual-autocorrelation correction, since the pooled batch quantiles come from independent paths.
DEFAULTS DIFFER FROM FQUEST and that is why the options argument is a pointer here: b0 = 25 rather than 50, and s is chosen from R rather than fixed, because the stage tests act on the R*b pooled statistics and so need fewer batches per replication. Passing nullptr takes both; passing a default constructed QuestOptions takes the FQUEST values instead, which is a different procedure, not a formality. Start from sim_firquest_options(R) when overriding one field.
Independent replications shorten the correlation the estimator has to fight, and they parallelize, but they reintroduce initialization bias in every path, so a short run length per replication is worse here than in sim_fquest. The reference reports slight undercoverage at p = 0.99 when the total sample is under 500000, down to 90.8%.
Reference: A. Lolos, C. Alexopoulos, D. Goldsman, K. D. Dingec, A. C. Mokashi, J. R. Wilson, "A Fixed-Sample-Size Procedure for Estimating Steady-State Quantiles Based on Independent Replications", Proc. Winter Simulation Conference, 2025.
Definition in file sim_firquest.h.