Quantitative Analysis logo

Quantitative Analysis

Community
nimadorostkar
quantitative-analysis

Use when applying statistical methods to financial data. Covers return distributions, stationarity, correlation versus causation, the multiple-testing problem, and the statistical traps specific to financial time series. Trigger on "is this signal statistically significant", "are these returns normally distributed", "is this correlation real or noise". Do not use for simulating a full strategy with costs — see the backtesting skill.

Overview

Publishernimadorostkar
RepositoryClaude-Skills-collection
Skill namequantitative-analysis
Stars
34
Forks
4
Bundled files
Instructions only
LicenseMIT
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 nimadorostkar on GitHub. Read the source before you install it.

Installation

Install the Quantitative Analysis 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/nimadorostkar/Claude-Skills-collection/tree/main/skills/finance/quantitative-analysis
  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/nimadorostkar/Claude-Skills-collection.git /tmp/Claude-Skills-collection
mkdir -p .claude/skills
cp -r /tmp/Claude-Skills-collection/skills/finance/quantitative-analysis .claude/skills/quantitative-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Quantitative Analysis 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 Quantitative Analysis 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 Quantitative Analysis 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.

Quantitative Analysis

Purpose

Apply statistics to financial data without being fooled by it. Financial time series violate nearly every assumption of standard statistical methods, and the tools will produce confident, well-formatted, wrong answers without complaint.

When to Use

  • Testing whether a signal has predictive value.
  • Modeling returns, volatility, or correlations.
  • Evaluating a quantitative claim someone else has made.
  • Building a factor model or a risk model.

Capabilities

  • Return distributions and their fat tails.
  • Stationarity, unit roots, and spurious regression.
  • Correlation, causation, and confounding.
  • Multiple-testing correction and data snooping.
  • Volatility modeling and clustering.

Inputs

  • The data, and an honest account of how it was selected.
  • The hypothesis — stated before the data was examined.
  • The number of hypotheses that have already been tested on this data.

Outputs

  • A result with its assumptions stated.
  • A significance level corrected for the number of tests actually run.
  • An honest statement of what the result does and does not support.

Workflow

  1. Look at the distribution before assuming one — Financial returns are not normal. They have fat tails and skew, and every method that assumes normality will underestimate the probability of a large move — which is the only probability that matters for survival.
  2. Test for stationarity — Regressing one non-stationary series on another produces a high R-squared and a significant t-statistic between two entirely unrelated things. This is spurious regression, and it is the most common error in financial statistics.
  3. Work in returns, not prices — Prices are non-stationary by construction. Returns are approximately stationary. Almost every meaningful analysis operates on returns.
  4. Count the hypotheses you have tested — If you tried a hundred signals and one has a p-value of 0.01, you have found exactly what pure chance predicts. A p-value not adjusted for the search is not evidence.
  5. Distinguish correlation from causation, and both from coincidence — With enough series, something will correlate with anything. A mechanism stated in advance is what separates a finding from a coincidence.
  6. Validate out of sample — On data that was not available when the hypothesis was formed. Everything else is description.

Best Practices

  • Financial returns have fat tails. A "six-sigma" event under a normal distribution should occur once in several million years; in markets it occurs every few years. Any model built on normality is quietly understating tail risk.
  • Non-stationarity produces spurious regressions with astonishing reliability. Two random walks will regress on each other with a significant t-statistic roughly 70% of the time. Always difference or test first.
  • Correlation between financial series is unstable. A correlation estimated over three years describes those three years, and it will not hold in the crisis you are trying to protect against.
  • The multiple-testing problem is the single largest source of false discovery in quantitative finance. The published anomaly literature is substantially a record of it.
  • In-sample fit is not evidence. Any sufficiently flexible model fits any dataset. The only test that means anything is out of sample.
  • Report the effect size, not just the p-value. A statistically significant edge of 0.02% per trade is not tradable after costs.

Examples

Spurious regression — the error that produces the most confident wrong answers:

python
import numpy as np, statsmodels.api as sm

# Two independent random walks. There is no relationship whatsoever.
np.random.seed(1)
a = np.cumsum(np.random.randn(500))
b = np.cumsum(np.random.randn(500))

model = sm.OLS(a, sm.add_constant(b)).fit()
print(f"R-squared: {model.rsquared:.3f}   t-stat: {model.tvalues[1]:.2f}")
# R-squared: 0.681   t-stat: 32.71
#
# An R-squared of 0.68 and a t-statistic of 33 between two series with NO
# relationship at all. This is not a fluke of the seed; it happens most of the
# time with non-stationary series. Any conclusion drawn from this is fiction.

# The correct procedure: test for stationarity, and work in returns.
from statsmodels.tsa.stattools import adfuller

for name, series in [("a", a), ("b", b)]:
    p = adfuller(series)[1]
    print(f"{name}: ADF p={p:.3f} -> {'non-stationary' if p > 0.05 else 'stationary'}")
# a: ADF p=0.712 -> non-stationary
# b: ADF p=0.884 -> non-stationary
#
# Differencing to returns removes the spurious relationship entirely.
model_returns = sm.OLS(np.diff(a), sm.add_constant(np.diff(b))).fit()
print(f"R-squared: {model_returns.rsquared:.4f}   t-stat: {model_returns.tvalues[1]:.2f}")
# R-squared: 0.0004   t-stat: -0.44   <- the truth: no relationship

Multiple testing — why most published anomalies are not real:

python
def corrected_significance(p_values: list[float], n_tested: int) -> Report:
    """A p-value of 0.01 means nothing if you tested 100 hypotheses."""
    best_p = min(p_values)

    # Bonferroni: the family-wise error rate.
    bonferroni = min(1.0, best_p * n_tested)

    # The probability that the best of n random signals looks this good by chance.
    prob_by_chance = 1 - (1 - best_p) ** n_tested

    return Report(
        raw_p=best_p,
        bonferroni_p=bonferroni,
        prob_at_least_one_by_chance=prob_by_chance,
        verdict=(
            "Not distinguishable from chance."
            if bonferroni > 0.05
            else "Survives correction. Now validate out of sample."
        ),
    )

# Tested 120 signal variants. The best has p = 0.008.
#   raw p                      : 0.008     "significant!"
#   Bonferroni-corrected p     : 0.96
#   P(at least one this good
#     by chance among 120)     : 0.62
#   Verdict: not distinguishable from chance.
#
# The signal is exactly as good as the best of 120 random signals would be
# expected to be. It is a discovery about the search, not about the market.

Notes

  • The spurious-regression demonstration above is the single most important thing in this skill. An R-squared of 0.68 between two unrelated random walks is not a corner case — it is the typical result, and it has produced a great many published findings.
  • Fat tails mean that variance is a poor risk measure for financial returns. Maximum drawdown and expected shortfall describe what actually hurts.
  • This is educational material about quantitative methodology, not financial advice, and none of it constitutes a recommendation.

Frequently asked questions

What does the Quantitative Analysis AI skill do?

Use when applying statistical methods to financial data. Covers return distributions, stationarity, correlation versus causation, the multiple-testing problem, and the statistical traps specific to financial time series. Trigger on "is this signal statistically significant", "are these returns normally distributed", "is this correlation real or noise". Do not use for simulating a full strategy with costs — see the backtesting skill.

Why use Quantitative Analysis on TypingMind?

Because you install it once and use it with any model. Quantitative Analysis 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 Quantitative Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/finance/quantitative-analysis. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Quantitative Analysis?

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 Quantitative Analysis?

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

Is the Quantitative Analysis AI skill free?

Yes. It is published on GitHub by nimadorostkar under the MIT 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 👇