SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.02927 · 2021

Causal Inference with Hidden Mediators

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2111.02927.json · badge: /api/ran/2111.02927.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
syanga/hidmed canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_mse Ran
ran on a synthesized input
syanga/hidmed/hidmed/metrics.py
code served (permissive licence) · get_code("726cec719d2d0c76")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample data for psi (array of estimates)
psi = np.array([1.2, 1.3, 1.1, 1.15, 1.25])

# Create a true value for comparison
true_psi = 1.0

# Define ARGS dict mapping all parameters
ARGS = {
    "psi": psi,
    "true_psi": true_psi
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
confidence_interval Ran
ran on a synthesized input
syanga/hidmed/hidmed/metrics.py
code served (permissive licence) · get_code("3fdbb6a18c9fa705")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

torch.manual_seed(0)

# The function takes a single parameter 'x' which should be a numpy array
# It calls: x.flatten(), len(), np.std(), np.sqrt()
# So x needs to be array-like with those methods

# Create a small numpy array with distinct dimensions for probing
x = np.array([[1.2, 3.4, 5.6, 7.8],
              [2.1, 4.3, 6.5, 8.9]])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_covered Ran
ran on a synthesized input
syanga/hidmed/hidmed/metrics.py
code served (permissive licence) · get_code("c5b3f5632fb13756")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample data for the is_covered function
# psi: array of estimates/samples
# true_psi: true parameter value

# Generate some sample estimates around a true value
np.random.seed(0)
true_value = 5.0
estimates = np.random.normal(loc=true_value, scale=0.5, size=20)

ARGS = {
    "psi": estimates,
    "true_psi": true_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sample_uniform_disjoint Ran
ran on a synthesized input
syanga/hidmed/hidmed/linear_dgp.py
code served (permissive licence) · get_code("eed43838a38fd0a5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (10,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    "low": 1.0,
    "high": 5.0,
    "size": 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (10,) — shape (10,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
score_nuisance_function Ran
ran on a synthesized input
syanga/hidmed/hidmed/minimax.py
code served (permissive licence) · get_code("0ffc9735ed57031f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

np.random.seed(0)

# Analyzing the function signature and usage:
# - h1: vector, used in element-wise multiplication with g1
# - kf0, kf1, kf2: matrices, used in dot products and linear algebra
# - kf: matrix, used as regularization term
# - g1, g2: vectors, used in element-wise multiplication
# - lambda2: scalar, regularization parameter

# All operations are matrix operations and dot products
# Dimensions need to be compatible for matrix multiplication

n_samples = 2  # batch size
n_features = 4  # feature dimension for kernel matrix
n_basis = 3    # basis dimension for beta vector

# Create compatible matrices and vectors
# kf0, kf1, kf2 should be (n_samples, n_basis) to multiply with beta
kf0 = np.random.randn(n_samples, n_basis).astype(np.float64)
kf1 = np.random.randn(n_samples, n_basis).astype(np.float64)
kf2 = np.random.randn(n_samples, n_basis).astype(np.float64)

# kf should be (n_basis, n_basis) for regularization
kf = np.random.randn(n_basis, n_basis).astype(np.float64)
kf = kf @ kf.T  # Make it symmetric positive definite

# h1, g1, g2 should be (n_samples,) vectors
h1 = np.random.randn(n_samples).astype(np.float64)
g1 = np.random.randn(n_samples).astype(np.float64)
g2 = np.random.randn(n_samples).astype(np.float64)

# lambda2 is a scalar
lambda2 = 0.1

ARGS = {
    "h1": h1,
    "kf0": kf0,
    "kf1": kf1,
    "kf2": kf2,
    "kf": kf,
    "g1": g1,
    "g2": g2,
    "lambda2": lambda2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
kkt_solve Not yet run
unverified (harvested, no recorded run)
syanga/hidmed/hidmed/minimax.py
code served (permissive licence) · get_code("5691213e71682935")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Proximal causal inference was recently proposed as a framework to identify causal effects from observational data in the presence of hidden confounders for which proxies are available. In this paper, we extend the proximal causal inference approach to settings where identification of causal effects hinges upon a set of mediators which are not observed, yet error prone proxies of the hidden mediators are measured. Specifically, (i) We establish causal hidden mediation analysis, which extends classical causal mediation analysis methods for identifying natural direct and indirect effects under no unmeasured confounding to a setting where the mediator of interest is hidden, but proxies of it are available. (ii) We establish hidden front-door criterion, which extends the classical front-door criterion to allow for hidden mediators for which proxies are available. (iii) We show that the identification of a certain causal effect called population intervention indirect effect remains possible with hidden mediators in settings where challenges in (i) and (ii) might co-exist. We view (i)-(iii) as important steps towards the practical application of front-door criteria and mediation analysis as mediators are almost always measured with error and thus, the most one can hope for in practice is that the measurements are at best proxies of mediating mechanisms. We propose identification approaches for the parameters of interest in our considered models. For the estimation aspect, we propose an influence function-based estimation method and provide an analysis for the robustness of the estimators.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2111.02927")
get_code_for_paper("2111.02927")
have("2111.02927")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2111.02927.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2111.02927.svg)](https://syntology.ai/paper/2111.02927)

Connect an agent — have() is free.