Single Parameter Estimation
Problem Formulation
Many applied studies fit a linear regression but report a conclusion about a single coefficient — the headline effect of one covariate. This task targets that estimand directly: given a dataset of \(n\) samples with features \(X \in \mathbb{R}^{n \times d}\) and responses \(y \in \mathbb{R}^n\), estimate the one coefficient \(\beta_j\) at a designated coefficient of interest index \(j\), released as a scalar.
The index \(j\) is part of the problem specification (metadata), so it is public: the privacy boundary still protects \((X, y)\) only.
Relationship to Linear Regression
single_parameter_estimation is a child of the
Linear Regression task. Any linear-regression algorithm
runs here for free: the framework lifts the instance to the full regression
(same \(X\), \(y\), dimensions, domains), runs the algorithm to estimate the full
\(\beta\), and then projects the result down to coordinate \(j\) — so the task
surfaces exactly the scalar it is about. A released standard error (se) is
projected the same way; the DP p-value (p_value) is left to inference
algorithms that produce one.
Conclusion-Replication Metrics
Rather than numerical accuracy of \(\beta_j\), this task ships metrics that ask
whether a DP fit reproduces the qualitative conclusion an analyst would draw
about the target coefficient. Both take the OLS reference from the non-private
OLS baseline algorithm run on the instance's own \((X, y)\) — the single source
of truth for "the OLS fit" — never a re-implemented least-squares solve:
sign_agreement— 1.0 if the released coefficient and the OLS fit agree on the sign of \(\beta_j\), 0.0 otherwise.verdict_agreement— for an algorithm that releases a DP p-value, 1.0 iff it matches the OLS baseline on both the sign of \(\beta_j\) and the 5% significance verdict (the releasedp_value < 0.05agreeing with whether the classical OLS t-test rejects \(H_0\!: \beta_j = 0\)). It isNaNfor a point-estimate algorithm that releases no p-value, so the metric is additive over a mixed algorithm set — only inference algorithms are scored.
Native Significance Test
Alongside the lifted linear-regression estimators, the task ships a native
inference algorithm, BarrientosSignificanceTest (Barrientos, Reiter,
Machanavajjhala & Chen, arXiv:1705.09561).
It is a significance test, not a point estimator: under pure \(\varepsilon\)-DP
it releases a DP verdict about \(\beta_j\) — the released coefficient carries
only the DP sign (no magnitude) and a DP p_value; se is None.
It uses subsample-and-aggregate of a scale-free statistic, so it needs no
clipping and no domain bounds: the data is partitioned into \(M\) disjoint subsets,
each subset's OLS t-statistic for \(\beta_j\) is truncated to \([-a, a]\), the
\(\sqrt{M}\)-rescaled mean is released under
\(\mathrm{Laplace}(0,\, 2a / (\sqrt{M}\,\varepsilon))\), and the two-tailed p-value
comes from a Monte-Carlo null reference that adds the same Laplace term. The
hyperparameters \(M\), \(a\), and n_mc are fixed and public (not DP-tunable). Its
(sign, p_value) output is scored by verdict_agreement.
The statistics module
The conclusion-replication statistic family — the primitives that combine a DP
mechanism's per-seed estimates and a reference into a combined-error
t-statistic — lives in
single_parameter_estimation.statistics
as pure functions over plain numbers (decompose, t_dp, sample_variance,
relative_bias, verdict). They do no fitting and touch no task or instance
objects: the regression fit that produces the estimates lives elsewhere, and this
module only combines the resulting scalars. Keeping them pure makes the statistic
independently testable and reusable by an analyst-side inference layer.
API Reference
Types, the parent adapter, instance generators, the statistics primitives, and metrics are documented from the source docstrings on the Single Parameter Estimation API Reference page.
Usage Example
from dp_testing_platform import ApproxDPBudget
from dp_testing_platform.tasks.single_parameter_estimation import (
SingleParameterEstimation,
)
from dp_testing_platform.tasks.single_parameter_estimation.instance_generators import (
GaussianCovariatesAndNoise,
)
# A synthetic instance targeting coefficient 0
gen = GaussianCovariatesAndNoise(
dim=3, n_samples=200, coefficient_of_interest_index=0, metric="sign_agreement"
)
metadata, input_data, metric = gen.generate(seed=0)
# Any linear-regression algorithm runs here; its full-beta output is projected
# down to the scalar coefficient of interest.
from dp_testing_platform.tasks.linear_regression.algorithms import VanillaSSP
ssp = VanillaSSP(C_x_clip=1.0, C_y_clip=1.0)
output = ssp.run(
metadata,
input_data,
ApproxDPBudget(1.0, 1e-5),
seed=0,
)
print(f"Released coefficient of interest: {output.coefficient:.4f}")
print(f"Sign agreement with OLS: {metric(output)}")