SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.10388 · 2023

The Causal Impact of Credit Lines on Spending Distributions

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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; 2 honoured the contract we drafted, 4 violated it and 0 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; 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/2312.10388.json · badge: /api/ran/2312.10388.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
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
MAE Ran
ran; our contract draft was wrong, not the code
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/training.py
code served (permissive licence) · get_code("10d43d4c45c48add")
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 Tensor, 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 torch

torch.manual_seed(0)

# Create small tensors for y_pred and target
# The function computes element-wise absolute difference and then takes mean
# So both tensors need the same shape
batch_size = 2
dim = 4

y_pred = torch.randn(batch_size, dim)
target = torch.randn(batch_size, dim)

ARGS = {
    "y_pred": y_pred,
    "target": target,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
compute_MAE Ran
ran, violated the contract we drafted
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/Simulation.py
code served (permissive licence) · get_code("551370153db92939")
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

# Construct arguments for compute_MAE
# The function takes two parameters: true (ground truth values) and pred (predicted values)
# Both are converted to numpy arrays and compared element-wise

true_values = np.array([1.0, 2.0, 3.0, 4.0])
pred_values = np.array([1.1, 2.2, 2.9, 4.1])

ARGS = {
    "true": true_values,
    "pred": pred_values
}
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
compute_RE Ran
ran, violated the contract we drafted
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/Simulation.py
code served (permissive licence) · get_code("cb53f46ab504b553")
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

# compute_RE takes two arguments: true (ground truth values) and pred (predicted values)
# Both are converted to numpy arrays and used in element-wise operations
# The function computes mean absolute relative error (relative error)

# Create small numpy arrays with distinct values
true_values = np.array([1.0, 2.0, 3.0, 4.0])
pred_values = np.array([1.1, 1.9, 3.2, 3.8])

ARGS = {
    "true": true_values,
    "pred": pred_values,
}
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
est_ECDF Ran
ran, violated the contract we drafted
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/baseline_models.py
code served (permissive licence) · get_code("153665c0520f4de1")
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 list, ndim 1, 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

# Construct arguments for est_ECDF function
y = np.array([1.5, 2.3, 0.8, 3.1, 1.2, 2.8, 0.5, 3.5])
quantiles = [0.25, 0.5, 0.75]
args = {}

ARGS = {
    'y': y,
    'quantiles': quantiles,
    'args': args
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
mean_square_loss Ran
ran, violated the contract we drafted
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/baseline_models.py
code served (permissive licence) · get_code("6ffc2fb29d81daec")
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

# y_pred: predictions - used as np.array() input, so can be list or array
# y_true: ground truth - used as np.array() input, so can be list or array
# Both are compared with subtraction and squared, so they must be numeric and same length

y_pred = [1.0, 2.0, 3.0, 4.0]
y_true = [1.1, 2.2, 2.9, 3.8]

ARGS = {
    "y_pred": y_pred,
    "y_true": y_true,
}
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
train_classical Ran
ran, honoured the contract we drafted
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/training.py
code served (permissive licence) · get_code("95ce4071f411c0ea")
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 list, ndim 3, 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Simple model that takes input and produces output
class SimpleModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Create a small model
model = SimpleModel(input_dim=4, output_dim=3)

# Create simple data loaders as lists of (X, y) tuples
# Batch size 2, input dim 4, output dim 3
def create_dataloader(num_batches=2, batch_size=2, input_dim=4, output_dim=3):
    dl = []
    for _ in range(num_batches):
        X = torch.randn(batch_size, input_dim)
        y = torch.randn(batch_size, output_dim)
        dl.append((X, y))
    return dl

dl_train = create_dataloader(num_batches=2, batch_size=2, input_dim=4, output_dim=3)
dl_test = create_dataloader(num_batches=1, batch_size=2, input_dim=4, output_dim=3)
dl_est_test_1 = create_dataloader(num_batches=1, batch_size=2, input_dim=4, output_dim=3)
dl_est_test_2 = create_dataloader(num_batches=1, batch_size=2, input_dim=4, output_dim=3)
dl_est_test_list = [dl_est_test_1, dl_est_test_2]

# Create args config
class Args:
    def __init__(self):
        self.lr = 0.001
        self.weight_decay = 0.0
        self.epochs = 2

args = Args()

# Device (CPU only)
device = torch.device('cpu')

ARGS = {
    'args': args,
    'model': model,
    'dl_train': dl_train,
    'dl_test': dl_test,
    'dl_est_test_list': dl_est_test_list,
    'device': device,
    'verbose': False
}
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 list, ndim 3, dtype family float — a list output has no array shape of its own; none is stated
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
train_regression Ran
ran, honoured the contract we drafted
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/training.py
code served (permissive licence) · get_code("aaea086188f36681")
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 list, ndim 3, 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)
    
    def loss_cal(self, pred, y, treat, n_treat, loss, reweight_sample):
        mae = nn.L1Loss()
        return mae(pred, y)

class ArgsConfig:
    def __init__(self):
        self.lr = 0.001
        self.weight_decay = 1e-5
        self.epochs = 2
        self.reg_met = 'simple'
        self.n_treat = 2
        self.loss = 'mae'
        self.reweight_sample = False

def create_dataloader(batch_size=2, num_batches=2, input_dim=5, output_dim=1):
    batches = []
    for _ in range(num_batches):
        X = torch.randn(batch_size, input_dim)
        y = torch.randn(batch_size, output_dim)
        batches.append((X, y))
    return batches

args = ArgsConfig()
model = SimpleModel(input_dim=5, output_dim=1)
dl_train = create_dataloader(batch_size=2, num_batches=2, input_dim=5, output_dim=1)
dl_test = create_dataloader(batch_size=2, num_batches=1, input_dim=5, output_dim=1)
dl_est_test_list = [create_dataloader(batch_size=2, num_batches=1, input_dim=5, output_dim=1)]
device = torch.device('cpu')

ARGS = {
    'args': args,
    'model': model,
    'dl_train': dl_train,
    'dl_test': dl_test,
    'dl_est_test_list': dl_est_test_list,
    'device': device,
    'verbose': False
}
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 list, ndim 3, dtype family float — a list output has no array shape of its own; none is stated
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
Cross_validate Not yet run
unverified (harvested, no recorded run)
lyjsilence/the-causal-impact-of-credit-lines-on-spending-distributions/baseline_models.py
code served (permissive licence) · get_code("edb0be8ffe5527cd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 8 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-23.

Repositories linked to this paper

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

Abstract

Consumer credit services offered by e-commerce platforms provide customers with convenient loan access during shopping and have the potential to stimulate sales. To understand the causal impact of credit lines on spending, previous studies have employed causal estimators, based on direct regression (DR), inverse propensity weighting (IPW), and double machine learning (DML) to estimate the treatment effect. However, these estimators do not consider the notion that an individual's spending can be understood and represented as a distribution, which captures the range and pattern of amounts spent across different orders. By disregarding the outcome as a distribution, valuable insights embedded within the outcome distribution might be overlooked. This paper develops a distribution-valued estimator framework that extends existing real-valued DR-, IPW-, and DML-based estimators to distribution-valued estimators within Rubin's causal framework. We establish their consistency and apply them to a real dataset from a large e-commerce platform. Our findings reveal that credit lines positively influence spending across all quantiles; however, as credit lines increase, consumers allocate more to luxuries (higher quantiles) than necessities (lower quantiles).

For agents

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

get_harvested_code_for_paper("2312.10388")
get_code_for_paper("2312.10388")
have("2312.10388")

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

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

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

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

Connect an agent — have() is free.