Ml4t Causal Identification logo

Ml4t Causal Identification

Organization
ml4t
ml4t-causal-identification

Validate causal claims using DAG adjustment sets, bad-control detection, and refutation tests. Use when distinguishing genuine factor effects from confounded associations.

Overview

Publisherml4t
Repositoryskills
Skill nameml4t-causal-identification
Stars
45
Forks
13
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ml4t on GitHub. Read the source before you install it.

Installation

Install the Ml4t Causal Identification AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ml4t/skills/tree/main/concepts/causal-identification
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ml4t/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/concepts/causal-identification .claude/skills/ml4t-causal-identification
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ml4t Causal Identification in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ml4t Causal Identification on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ml4t Causal Identification is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Causal Identification

A factor with IC 0.04 could be a real effect or a confounded association. Without a DAG and refutation tests, you cannot tell which. Conditioning on the wrong variables - mediators, colliders, post-treatment - can create or destroy apparent signal.

The Problem

"Kitchen sink regression" - conditioning on every available variable - is the default in ML pipelines. But including a collider (e.g., fund flows driven by both momentum and returns) induces spurious correlation (~-0.25 between independent variables). Including a mediator (the channel through which the treatment operates) attenuates the true effect. Including a post-treatment variable introduces bias of unknown sign. The DAG determines which variables are admissible controls.

The Pattern

WRONG

python
import numpy as np
from sklearn.linear_model import Ridge

# Kitchen-sink: include everything as controls
# fund_flow is a COLLIDER (driven by both momentum and returns) - induces bias
X = np.column_stack([momentum, volatility, fund_flow, sector_return])
model = Ridge().fit(X, forward_returns)
print(f"Momentum coeff: {model.coef_[0]:.4f}")  # Biased by collider conditioning

CORRECT

python
from dowhy import CausalModel

# Step 1: Specify DAG - encode your mechanism assumptions
graph = """
digraph {
    volatility -> momentum;
    volatility -> forward_returns;
    momentum -> forward_returns;
    momentum -> fund_flow;
    forward_returns -> fund_flow;
}"""
# fund_flow is a collider (momentum -> fund_flow <- forward_returns)
# It must NOT be in the adjustment set

# Step 2: Identify estimand from the DAG
model = CausalModel(data=df, treatment="momentum",
                     outcome="forward_returns", graph=graph)
estimand = model.identify_effect()
# DoWhy computes the backdoor adjustment set: {volatility}

# Step 3: Estimate with valid controls only
estimate = model.estimate_effect(estimand, method_name="backdoor.linear_regression")
print(f"Causal effect: {estimate.value:.4f}")

Adjustment Set Rules

Variable RoleInclude as Control?Why
Confounder (common cause of T and Y)YesBlocks backdoor paths
Pre-treatment predictor of YYesImproves precision
Mediator (on causal path T→M→Y)NoChanges estimand
Collider (common effect of T and Y)NoInduces spurious correlation
Post-treatment variableNoBias of unknown sign

Pre-treatment timing discipline: only condition on variables determined strictly before treatment time. Do not condition on portfolio outcomes, realized performance, or contemporaneous market variables.

Refutation Tests

Every causal claim must survive refutation before informing trading decisions:

python
# Placebo treatment: replace momentum with random noise - effect should vanish
placebo = model.refute_estimate(estimand, estimate, method_name="placebo_treatment_refuter")
print(f"Placebo effect: {placebo.new_effect:.4f}")  # Should be ~0

# Sensitivity: how strong must an omitted confounder be to flip the sign?
sensitivity = model.refute_estimate(estimand, estimate,
    method_name="add_unobserved_common_cause",
    confounders_effect_on_treatment="linear", confounders_effect_on_outcome="linear",
    effect_strength_on_treatment=0.5, effect_strength_on_outcome=0.5)

If a confounder at 10-20% effect strength flips the sign, the result is fragile.

Guardrails

  • Specify the DAG before fitting - post-hoc DAGs rationalize results instead of testing assumptions
  • Never condition on colliders - the fund-flow collider trap creates ~-0.25 spurious correlation between independent variables
  • Enforce pre-treatment timing - all controls must be determined strictly before treatment time
  • Placebo tests are mandatory - a pipeline that finds effects with random treatment is broken
  • Sensitivity analysis calibrates confidence - report the confounder strength at which the effect flips sign
  • Causal discovery (PCMCI, NOTEARS) generates hypotheses, not conclusions - validate discovered structure with independent data

Production Implementation

No ml4t-* library covers causal estimation. Use DoWhy for identification and refutation, EconML for Double Machine Learning on continuous treatments, and tfp-causalimpact for discrete event studies:

python
from econml.dml import LinearDML
from sklearn.ensemble import GradientBoostingRegressor

dml = LinearDML(model_y=GradientBoostingRegressor(), model_t=GradientBoostingRegressor())
dml.fit(Y=returns, T=momentum, W=confounders)  # W = valid adjustment set from DAG
print(f"ATE: {dml.ate():.4f}, 95% CI: {dml.ate_interval()}")

Checklist

  • DAG specified and committed before any estimation
  • Adjustment set derived from backdoor criterion - no colliders, mediators, or post-treatment variables
  • Estimand declared (ATE, ATT, or CATE) before fitting
  • Placebo treatment test returns near-zero effect
  • Sensitivity analysis reports the confounder strength that flips the sign
  • Results stable across subperiods and alternative nuisance model specifications

Frequently asked questions

What does the Ml4t Causal Identification AI skill do?

Validate causal claims using DAG adjustment sets, bad-control detection, and refutation tests. Use when distinguishing genuine factor effects from confounded associations.

Why use Ml4t Causal Identification on TypingMind?

Because you install it once and use it with any model. Ml4t Causal Identification is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ml4t Causal Identification in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ml4t/skills/tree/main/concepts/causal-identification. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Ml4t Causal Identification?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ml4t Causal Identification?

As many as you like. As long as a model supports skills, you can use Ml4t Causal Identification with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ml4t Causal Identification AI skill free?

Yes. It is published on GitHub by ml4t under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇