vcnet
Estimates a smooth causal dose-response curve from observational data with continuous treatment, covariates, and outcome. Returns confidence intervals and diagnostics.
Instructions
Varying-coefficient dose-response estimator. Assumptions: Unconfoundedness given covariates X (no hidden confounding of the continuous treatment); Positivity over the dose: every dose has support across X; The dose-response curve is smooth (varying-coefficient prior). Pre-conditions: data with a continuous treatment (dose), outcome and covariates; torch is installed (neural extra) -- imported lazily. Failure modes: Sparse support at extreme doses yields an unreliable dose-response curve there -> Restrict the reported dose range to the supported region or compare against scigan. Alternatives: sp.scigan, sp.dose_response. Typical minimum N: 500.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | Outcome variable column name or outcome array. | |
| alpha | No | Significance level for confidence intervals and tests. | |
| ridge | No | Tikhonov regularisation on the coefficient matrix. | |
| detail | No | Payload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip. | agent |
| t_grid | No | Treatment values at which to evaluate the dose-response curve. Defaults to 40 equally-spaced points between the observed min/max. | |
| n_basis | No | Number of B-spline basis functions for the t-axis. | |
| as_handle | No | If true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running. | |
| data_path | Yes | Absolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://. | |
| result_id | No | Optional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns. | |
| treatment | Yes | Continuous treatment / dose column. | |
| covariates | Yes | Covariate matrix, DataFrame, or column names. | |
| n_bootstrap | No | Number of bootstrap replications. | |
| data_columns | No | Optional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads. | |
| random_state | No | Random seed or RandomState for reproducible stochastic steps. | |
| data_sample_n | No | Optional uniform random subsample size (seed=0, deterministic) — useful on huge panels. | |
| spline_degree | No | spline_degree parameter (int). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||