Observed since 20 Oct, 20:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
adversarial-nets-lib-econ
Adversarial estimator for structural models on graphs
Adversarial estimator for graph structural models extends the theoretical framework proposed by Kaji et al. (2023) to structural models defined on graphs (strategic communication games, peer-effect models, etc.). With graph data, the entire network is typically a single realization; to create variability for the discriminator we sample subgraphs from both the ground truth and the synthetic graph and label them by origin. Intuitively, local neighborhoods contain enough information about global structure for discrimination; our current implementation uses $k$-hop ego sampling. Additional challenges include multiple equilibria in dynamic network models, lack of closed-form asymptotics, and the need to tailor the discriminator architecture to the structural class.
Observed data. Let $G=(X,Y,N,A)$ where:
We work with a peer operator $P(A)$ that excludes self-links:
P(A) = A - \mathrm{diag}(A)
Optionally, $P(A)$ may be row/degree-normalized; we only require $\mathrm{diag}!\big(P(A)\big)=0$.
Structural model (generator). A structural mapping
m_\theta:\ \big(X,\ P(A),\ Y^{(0)},\ \xi\big)\ \longmapsto\ Y' \in \mathbb{R}^{n\times \ell}
takes covariates, the peer operator, and an initial outcome state $Y^{(0)}$ (e.g., pre-interaction signals, baselines, or zeros) and returns simulated outcomes $Y'$. The innovation $\xi$ captures simulation randomness if present.
Y' = m_\theta\!\Big(X,\ P(A)\,Y^{(0)},\ \xi\Big),
i.e., each $y_i'$ depends on $x_i$ and peers’ initial outcomes ${y_j^{(0)}: j\in\mathcal{N}(i)}$, but not on $y_i^{(0)}$ directly.
Y^{(t+1)} = m_\theta\!\Big(X,\ P(A)\,Y^{(t)},\ \xi^{(t)}\Big),
\qquad Y' \equiv Y^{(T)}.
Synthetic data. Define $G'(\theta)=(X,\ Y',\ N,\ A)$ with $Y'=m_\theta(X,P(A),Y^{(0)},\xi)$. Exogenous features and topology are held fixed so identification comes from matching the distribution of outcomes over sampled subgraphs.
Subgraph sampling. Let $\mathsf{S}$ denote a randomized sampler (e.g., $k$-hop ego nets or rooted random-walk subgraphs). Sampling from $G$ induces $p_{\mathrm{data}}^{\mathsf{S}}$ over subgraphs $g$; sampling from $G'(\theta)$ induces $p_{\theta}^{\mathsf{S}}$.
Discriminator. A GNN discriminator $D_\phi: g\mapsto[0,1]$ outputs the probability that $g$ came from $p_{\mathrm{data}}^{\mathsf{S}}$.
Adversarial objective (Goodfellow-style). Estimate $\theta$ by
\min_{\theta}\ \max_{\phi}\
\mathbb{E}_{g\sim p_{\mathrm{data}}^{\mathsf{S}}}\!\big[\log D_\phi(g)\big]
\;+\;
\mathbb{E}_{g\sim p_{\theta}^{\mathsf{S}}}\!\big[\log\big(1-D_\phi(g)\big)\big].
At the optimal discriminator this minimizes the Jensen–Shannon divergence between $p_{\mathrm{data}}^{\mathsf{S}}$ and $p_{\theta}^{\mathsf{S}}$.
Discriminator. Implement $D_\phi$ with PyTorch Geometric. Use the same sampler $\mathsf{S}$ (e.g., $k$-hop ego nets or rooted random-walk subgraphs) for real and synthetic graphs to keep the target distribution fixed.
Generators.
generate_outcomes(θ) for counterfactual simulation.Optimization. Treat the outer problem as black-box in $\theta$. Bayesian optimization is a reasonable default; use binary cross-entropy from the objective above (not accuracy) as the scalar loss. The estimator exposes an outer_optimizer switch: keep "gp" (default, via skopt.gp_minimize) or set "nelder-mead" to activate SciPy's derivative-free simplex routine. Additional optimizer arguments can be supplied through outer_optimizer_params (legacy code using gp_params continues to work when the GP optimizer is selected). SciPy is declared as a project dependency.
linear_in_means_model.ipynbA two-parameter testbed illustrating training curves and objective values. For linear-in-means,
Y = (I-\rho P)^{-1}(X\beta+\varepsilon),
the no-self-loop restriction holds via $P(A)$ and invertibility requires
|\rho| < 1/\lambda_{\max}(P).
Kaji, T., Manresa, E., & Pouliot, G. (2023). An adversarial approach to structural estimation. Econometrica, 91(6), 2041–2063.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
numpyEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | numpy>=1.21.0 | runtime |
networkxEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | networkx>=2.6.0 | runtime |
matplotlibEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | matplotlib>=3.4.0 | runtime |
scikit-optimizeEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | scikit-optimize>=0.9.0 | runtime |
tqdmEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | tqdm>=4.62.0 | runtime |
scipyEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | scipy>=1.7.0 | runtime |
torchEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | torch>=2.0.0 | runtime |
torch-geometricEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | torch-geometric>=2.3.0 | runtime |
scikit-learnEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | scikit-learn>=1.0 | runtime |
optunaEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | optuna>=3.0.0 | runtime |
bdist_wheel · 16.59 KB · Python py3
sdist · 22.62 KB · Python source
Observed since 20 Oct, 20:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:ebab5601d0795302c229a1ea4e6eacc2592bb002f579fcbf053e034e923b9529