telescopic.estimators¶
Estimator weights and the estimators derived from signed measures.
- telescopic.estimators.averaging_times(k, m, thin)¶
The averaging set \(S = \{k, k + s, k + 2s, \dots\} \cap [k, m]\) for
thin= s.
- telescopic.estimators.correction_coefficients(t, k, m, lag, thin)¶
Coefficients \(c_t\) of the differences in the thinned estimator \(H_S\).
\[c_t = |S|^{-1}\,\#\{l \in S : l \le t - L,\ L \mid (t - l)\}\]with \(S\) from
averaging_times(). Forthin= 1 it is \(v_t/(m-k+1)\) with the lag weights \(v_t\) (The time-averaged estimator, in Theory). The count is computed in constant time per \(t\): \(l = k + js\) satisfies the congruence \(js \equiv t - k \pmod L\), whose solutions form one residue class modulo \(L/\gcd(s, L)\) when \(\gcd(s, L)\) divides \(t - k\), and none otherwise.
- telescopic.estimators.unbiased_covariance(first, second)¶
Unbiased estimate of \(\mathrm{Cov}_\pi(h)\) from \(R \ge 2\) replicates.
\[\widehat{\mathrm{Cov}}_\pi(h) = \bar b - \bar a\bar a^\top + S_a/R\]with \(a_r = \hat\pi_r(h)\), \(\bar b\) the mean of \(\hat\pi_r(hh^\top)\) and \(S_a\) the sample covariance of the \(a_r\). The last two terms are minus the U-statistic \(\sum_{r \ne s} a_r a_s^\top / (R(R-1))\), which is unbiased for \(\pi(h)\pi(h)^\top\); the plug-in \(\bar a\bar a^\top\) is biased by \(\mathrm{Cov}(\bar a)\).
- telescopic.estimators.unbiased_variance(first, second)¶
Unbiased estimates of the variances of \(h\).
The diagonal of
unbiased_covariance(), without the off-diagonal cost: \(\bar b_j - \bar a_j^2 + S_{a,jj}/R\).
- telescopic.estimators.weighted_quantile(values, weights, q)¶
Quantiles of a signed measure on the line.
Equal values are merged, the cumulative weights are projected onto non-decreasing sequences by isotonic regression and clipped to [0, 1], and the quantile at level \(\beta\) is the smallest value whose projected cumulative weight is at least \(\beta\); at a level that a cumulative weight equals exactly, rounding of the sums decides between two neighboring values. For non-negative weights this is the inverted-CDF quantile. The result is consistent as the number of replicates grows, not unbiased (Jacob, O’Leary & Atchadé 2020, Proposition 3.2).
- Parameters:
- values
ndarray, shape (N,) Finite values.
- weights
ndarray, shape (N,) Finite signed weights, summing to 1.
- qarray_like of
floatin [0, 1] The levels of the quantiles.
- values
- Returns:
ndarray, shape ofq