Skip to contents

Package overview

RdistNN-package RdistNN
RdistNN: DNN Estimation for CATE and Nonparametric Regression

CATE and regression — estimators and weights

The focus of the initial public release: conditional average treatment effects, nonparametric regression, and their DNN weight builders.

cate_dnn()
CATE via DNN rank weights (orthogonalized local averaging)
np_dnn()
Nonparametric regression via DNN rank weights
np_tdnn()
Nonparametric regression via TDNN rank weights
weights_matrix()
Compute weight matrix W via an arbitrary ranking + weight mapping
weights_dnn()
DNN weights (choose method), distance-based ranking
weights_dnn_exact()
DNN weights (exact full-U), distance-based ranking
weights_dnn_asymp()
DNN weights (asymptotic full-U), distance-based ranking

S3 methods

CATE inference methods, regression printing, and shared diagnostics and candidate views.

candidate_fit() candidate_fits()
Extract one candidate view from a grid fit
diagnostics() print(<dnn_diagnostics>)
Compute diagnostics for fitted localized estimators
print(<cate_result>)
Print a cate_result object
print(<np_result>)
Print an np_result object
print(<score_diff_path>)
Print a score_diff_path object
print(<summary.cate_result>)
Print a summary.cate_result object
print(<tdnn_np_result>)
Print a tdnn_np_result object
print(<ustat_score>)
Print a ustat_score object
print(<weights_result>)
Print a weights_result object
summary(<cate_result>)
Summarize a cate_result object
confint(<cate_result>)
Confidence intervals for cate_result
coef(<cate_result>)
Extract coefficients from a cate_result
predict(<cate_result>)
Predict from a cate_result object at new targets

Plotting

ggplot2-based panels for fitted objects (ggplot2 is a suggested dependency), and the tidy data extractors underneath them; see the visualization and diagnostics articles.

plot_estimates() autoplot.np_result() autoplot.cate_result() autoplot.plqr_result() autoplot.gmm_result() plot(<np_result>) plot(<cate_result>) plot(<plqr_result>) plot(<gmm_result>)
Plot estimates with confidence bounds across target points
plot_weights()
Plot DNN weight profiles, concentration, and effective kernels
plot_overlap()
Plot local overlap for CATE fits
plot_dashboard()
Compose a diagnostics dashboard for a fitted object
plot_influence()
Plot per-observation contributions to a CATE estimate
plot_tuning()
Plot estimate sensitivity to the kernel order
autoplot.dnn_diagnostics() plot(<dnn_diagnostics>)
Plot per-target weight diagnostics
plot_data_estimates()
Extract a tidy estimates frame from a fitted RdistNN object
plot_data_weights()
Extract a tidy weight-profile frame from a fitted RdistNN object
plot_data_diagnostics()
Extract the per-target diagnostics frame from a fitted RdistNN object

Kernel-order tuning

Tuning specifications, registry helpers, and paper-default rules.

new_tuning()
Construct a tuning spec
as_tuning()
Wrap a function as a tuning spec
is_tuning()
Is this a tuning spec?
register_tuning()
Register a tuning spec under a name
get_tuning()
Retrieve a registered tuning spec
tuning_names()
List registered tuning names
tuning_eval()
Evaluate a tuning spec
tuning_dnn_paper()
Paper-default undersmoothing rule for kernel order

Demo data & utilities

cate_demo_data()
Minimal CATE demo data (oracle nuisances + pseudo-outcome)
cate_demo_subsets()
Quick helper: sample a batch of subsets (for U-stat experiments)
np_demo_data()
Minimal nonparametric regression demo data (oracle m and Y only)
np_demo_subsets()
Quick helper: sample a batch of subsets (singleton by default)

General CATE simulation tools

Synthetic benchmarks and Monte Carlo summaries. The current affine paper uses the separate study-specific replication bundle.

sim_cate_data()
Draw one sample from a named CATE simulation DGP
sim_cate_one_rep()
Run one replicate of CATE estimators
sim_cate_run()
Run the CATE simulation grid
sim_cate_methods()
List available CATE simulation methods
summarise_sim_results()
Summarise raw per-replicate CATE simulation results

Experimental — PLQR

All PLQR interfaces are experimental and outside the CATE and regression focus of this release. The wrapper evaluates moments at supplied coefficients; it does not solve for local coefficients. APIs and inference interfaces may change.

plqr_dnn()
PLQR local moment evaluation and direct coefficient inference via DNN rank weights (experimental)
plqr_score_matrix()
Observation-level orthogonal PLQR scores at a supplied coefficient (experimental)
score_plqr_component()
PLQR diagnostic score (component \(j\)); pure score (no weights, no fitting) (experimental)
plqr_demo_data()
Minimal PLQR demo data (oracle nuisances; no internal fitting) (experimental)
plqr_demo_subsets()
Quick helper: sample a batch of subsets (for U-stat / localization experiments) (experimental)
print(<plqr_result>)
Print a plqr_result object (experimental)
print(<summary.plqr_result>)
Print a summary.plqr_result (experimental)
summary(<plqr_result>)
Summarize a plqr_result (experimental)
confint(<plqr_result>)
Confidence intervals for plqr_result (experimental)
coef(<plqr_result>)
Extract coefficients from a plqr_result (experimental)
vcov(<plqr_result>)
Variance-covariance matrices for plqr_result (experimental)
predict(<plqr_result>)
Predict from a plqr_result object at new targets (experimental)
plot_conditioning()
Plot local design conditioning for PLQR fits (experimental)
plot_calibration()
Plot local quantile calibration for PLQR fits (experimental)

Experimental — local IV-GMM (companion paper)

Experimental companion functionality for the GMM paper; API and theorem alignment may change before that paper is released.

gmm_dnn()
Local GMM estimation via DNN rank weights
iv_demo_data()
Minimal IV-GMM demo data
sim_iv_data()
Draw one sample from a named IV-GMM simulation DGP
sim_iv_one_rep()
Run one replicate of IV-GMM estimators
sim_iv_run()
Run the IV-GMM simulation grid
sim_iv_methods()
List available IV simulation methods
summarise_iv_results()
Summarise raw IV-GMM simulation results
new_gmm_model()
Create a local GMM model object
is_gmm_model()
Test whether an object is a GMM model
gmm_model_dr_iv()
Doubly robust IV GMM model
print(<gmm_result>)
Print a gmm_result object
print(<summary.gmm_result>)
Print a summary.gmm_result
summary(<gmm_result>)
Summarize a gmm_result
confint(<gmm_result>)
Confidence intervals for gmm_result
coef(<gmm_result>)
Extract coefficients from a gmm_result
vcov(<gmm_result>)
Variance-covariance matrices for gmm_result

Developer API — scores (U-stat kernels)

Extension points for custom scores: S3 spec, helpers, generics, registries, and built-in score topics.

new_score()
Score specification (S3) for U-stat kernels
score_setup()
Set up score context (precomputation)
score_order()
Resolve kernel order s
score_eval()
Evaluate kernel on one subset
score_eval_batch()
Evaluate kernel on many subsets (R fast-path)
as_score()
Coerce a plain function to a score (simple cases)
is_score()
Is object a ustat_score?
is_compiled()
Does a score have a compiled implementation?
register_score()
Register a score
get_score()
Retrieve a registered score
list_scores()
List registered scores
score_np_y()
Nonparametric regression singleton score from observed outcome \(Y\) (order-1 pure score; no weights)
score_cate_rho()
CATE score from a precomputed pseudo-outcome \(\rho\) (pure score; no weights)
score_diff_path()
Build a modular differentiable path for a score

Developer API — distances (rankers)

Extension points for custom distances: S3 spec, helpers, generics, registries, and built-in distance constructors.

new_distance()
Construct a distance spec
distance_eval()
Evaluate a distance spec at a single target
distance_eval_batch()
Evaluate a distance spec for many targets (batch)
as_distance()
Wrap a function as a distance spec
is_distance()
Is this a distance spec?
register_distance()
Register a distance spec under a name
get_distance()
Retrieve a registered distance spec
distance_names()
List registered distances
distance_l2()
L2 distance spec (single and batched evaluation)
distance_l1()
L1 distance spec (single and batched evaluation)
distance_l2_scaled()
Scaled L2 distance spec (one-time setup + eval/batch)
distance_l1_scaled()
Scaled L1 distance spec (one-time setup + eval/batch)
distance_mahalanobis()
Mahalanobis distance spec (with one-time covariance setup)

Developer API — rank → weight mappings

Extension points for custom rank weights: S3 spec, evaluators, registry, and the single-scale DNN rank-weight constructors.

new_rank_weight()
Construct a rank-weight spec
rank_weight_eval()
Evaluate rank-weight for a single target
rank_weight_eval_batch()
Evaluate rank-weight for many targets (batch)
as_rank_weight()
Wrap a function as a rank_weight spec
is_rank_weight()
Is this a rank_weight spec?
register_rank_weight()
Register a rank_weight under a name
get_rank_weight()
Retrieve a registered rank_weight
rank_weight_names()
List registered rank_weight names
rank_weight_dnn_exact()
Rank-weight: DNN exact (full U, WOR)
rank_weight_dnn_asymp()
Rank-weight: DNN asymptotic (full U, WOR)

Advanced — TDNN and jackknife-paper infrastructure

Two-scale DNN estimation and the leave-one-out jackknife primitives supporting the generalized U-statistics companion paper.

weights_tdnn()
TDNN weights (choose method, k = 1), distance-based ranking
weights_tdnn_exact()
TDNN weights (exact, k = 1), distance-based ranking
weights_tdnn_asymp()
TDNN weights (asymptotic, k = 1), distance-based ranking
rank_weight_tdnn_exact()
Rank-weight spec: TDNN exact (Demirkaya two-scale DNN, k = 1)
rank_weight_tdnn_asymp()
Rank-weight spec: TDNN asymptotic (Demirkaya two-scale DNN, k = 1)
plot_tdnn_scales()
Plot the TDNN two-scale decomposition
jackknife_fast_rank()
Fast delete-one jackknife for rank-weighted functionals (auto C++ when available, R fallback otherwise)
jackknife_rank_full()
Generic rank-order delete-one jackknife (prefix/suffix engine)
jackknife_slow_rank()
Slow delete-one jackknife for rank-weighted L-stat rules (fixed ranks)