Skip to content

Guide · Agent skill

How to use the Quantitative Statistics Methods agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The quant-statistics skill teaches an AI agent to run standard quantitative finance statistics on price or return data, including unit-root (ADF) tests, cointegration and pair-trading hedge ratios, Granger causality, GARCH volatility modeling, regression diagnostics and bootstrap methods. It is for quant researchers, students learning time-series tests, and developers working in the Vibe-Trading codebase. After this guide you will know how to install the skill, ask for these analyses in plain language, and check the results the way the skill expects.

Quantitative Statistics MethodsHKUDS/Vibe-Trading · MIT

Quick start

  1. 1Get the repository. Make sure the Vibe-Trading repository with src.quantlib.timeseries is available, along with Python, numpy and pandas.
  2. 2Install the optional packages. Install statsmodels for most tests and arch if you need GARCH, using the pip commands in the requirements section.
  3. 3Download and unzip the skill. Download the ZIP from this page and unzip it so SKILL.md sits in a quant-statistics folder.
  4. 4Place the skill folder. Put it in ~/.claude/skills/ for all projects or in .claude/skills/ for one project, or upload it under Settings, Capabilities, Skills in the Claude apps.
  5. 5Make a natural request. Describe the data and the test you want, such as checking stationarity or fitting GARCH on daily returns.
  6. 6Check the output against the rules. Read p-values using the ADF thresholds, check half-life and persistence, and annualise volatility where needed.

What an agent skill is and what this one makes the agent do

An agent skill is a folder containing a SKILL.md file that gives an AI agent specific instructions for a task. When a request matches the skill, the agent follows those instructions. This skill covers statistical work on financial time series.

Its central instruction is to call tested functions from the project's own quant library, src.quantlib.timeseries, instead of retyping formulas. The skill also sets interpretation rules, such as p-value thresholds, half-life sanity checks and annualising volatility. If a required package is missing, the agent is told to report the error to you rather than quietly switching to a different method.

  • ADF unit-root test for stationarity (adf_test)
  • Cointegration test and pair-trading hedge ratio (cointegration_test, find_hedge_ratio, compute_half_life)
  • Granger causality (granger_test)
  • GARCH volatility fitting and forecasting (fit_garch)
  • Regression diagnostics: heteroscedasticity, autocorrelation and VIF (heteroscedasticity_test, autocorrelation_test, vif_test)
  • Bootstrap methods (bootstrap_statistic, bootstrap_sharpe)
from src.quantlib.timeseries import adf_test, cointegration_test, find_hedge_ratio, compute_half_life, granger_test, fit_garch, heteroscedasticity_test, autocorrelation_test, vif_test, bootstrap_statistic, bootstrap_sharpe

How do you install the quant-statistics skill?

Download the ZIP for this skill from this page and unzip it. The skill folder should contain SKILL.md. Then choose one of the two install locations below.

For a personal install across all projects, unzip it into your user skills folder at ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder.

In the Claude apps, you can instead upload the skill under Settings, then Capabilities, then Skills.

  • Personal: ~/.claude/skills/quant-statistics/SKILL.md
  • Project: .claude/skills/quant-statistics/SKILL.md inside your project
  • Claude apps: Settings → Capabilities → Skills → upload

What must be installed before the skill works?

The skill needs the Vibe-Trading repository with src.quantlib.timeseries available, plus Python with numpy and pandas. Without that repository the functions do not exist, so the skill cannot run as written.

statsmodels is needed for ADF, cointegration, Granger and the diagnostics. arch is needed only for GARCH. Neither is a declared dependency of vibe-trading-ai, so you install them yourself. The skill's requirements list the minimum versions; use the commands below.

Importing the module always works. A missing package only shows up when you call a function that needs it, and then the error names the package and the install command.

  • Vibe-Trading repository with src.quantlib.timeseries
  • Python with numpy and pandas
  • statsmodels (ADF, cointegration, Granger, diagnostics)
  • arch (GARCH only)
pip install "statsmodels>=0.14" pip install "arch>=6.0"

How do you trigger the skill with a natural request?

You do not need special syntax. Describe the statistical check you want on your data, and mention the series and what you want to learn. The agent should match the request to the skill and call the library functions.

Name the data precisely. Say whether you are working with prices, log returns, a pair of price series, or a return series for a Granger test. The skill's rules depend on that: price series are usually non-stationary, so it tells the agent to use log returns.

  • Is the close price series of this stock stationary? Run an ADF test and tell me what to do next.
  • Test whether these two price series are cointegrated and give me the hedge ratio and half-life.
  • Fit a GARCH(1,1) to these daily returns and forecast volatility for the next 5 days, annualised.
  • Does trading volume help predict returns at lags up to 5? Run a Granger test.
  • Check my regression residuals for heteroskedasticity and autocorrelation.

How do the core tests work and how do you read them?

For the ADF test, a p-value below 0.01 is strongly stationary, 0.01 to 0.05 is stationary and usable, 0.05 to 0.10 is weak evidence that calls for differencing and retesting, and above 0.10 is non-stationary. The skill's table also notes that price series are usually non-stationary, while log returns usually are stationary.

For cointegration, both legs must be individually non-stationary, so check each with adf_test first. The two series must also share one index. The skill raises a ValueError instead of pairing rows by position, so align the two legs before calling.

  • ADF: p < 0.01 strongly stationary; 0.01 to 0.05 stationary; 0.05 to 0.10 weak; above 0.10 non-stationary
  • Pair trading z-score thresholds in the skill: above 2.0 short the spread; above 1.5 small short; below -1.5 small long; below -2.0 long; near 0 close
  • half_life is in observation periods (days for daily bars) and is inf when the spread does not mean-revert
  • Granger: testing 5 lags is 5 hypothesis tests, so one small p-value is weak evidence
from src.quantlib.timeseries import adf_test result = adf_test(prices['close'], significance=0.05) if not result['is_stationary']: returns = np.log(prices['close']).diff().dropna() adf_test(returns)

How do you work with GARCH volatility output?

fit_garch expects returns as fractions, where 0.01 means 1 percent, and rescales to percent internally. The forecast should decay from current volatility toward long-run volatility. If it does not decay, persistence is probably too close to 1.

All volatilities are daily fractions. Multiply by the square root of 252 to annualise. long_run_vol is nan when persistence is 1 or more, which means the long-horizon forecast is not usable. The skill's variants are EGARCH and GJR-GARCH for asymmetric shocks and FIGARCH for long memory. The skill's default is plain GARCH(1,1).

  • Input: returns as fractions (0.01 = 1%)
  • Forecast should decay toward long_run_vol
  • Annualise daily volatility by multiplying by the square root of 252
  • Persistence (alpha + beta) is usually 0.95 to 0.99 according to the skill
from src.quantlib.timeseries import fit_garch result = fit_garch(returns, horizon=5)

What should you know about the regression and bootstrap parts?

The skill lists heteroscedasticity_test, autocorrelation_test and vif_test for regression diagnostics, and bootstrap_statistic and bootstrap_sharpe for bootstrap methods. The two bootstrap helpers use only numpy.

The copy of SKILL.md this page is based on ends partway through its regression section, so this guide does not describe the inputs or outputs of those diagnostic functions. Check the function definitions in the repository before relying on them, and ask the agent to show you the parameters it uses.

  • Bootstrap helpers depend only on numpy
  • Regression diagnostics section is incomplete in the copy reviewed

What safety limits should you keep in mind?

The skill runs scripts, so the agent executes Python code against your data. It does not use the network. Review the code the agent runs, especially when working with real datasets.

The skill's own warnings matter most. A good cointegration p-value does not mean the pair will converge within your holding period, so check the half-life. A degenerate series, such as one that is flat for the whole window, makes the hedge-ratio calculation raise an error. The skill tells the agent to treat that as missing data, not to work around it.

  • Runs scripts: yes. Uses network: no.
  • Compare half-life to your holding horizon before trading.
  • Flat or halted legs raise ValueError; treat them as unusable data in that window.
  • Granger results are predictive, not causal.

What people use it for

  • Checking whether a price series is stationary and switching to log returns when it is not
  • Testing whether two stocks are cointegrated and estimating a hedge ratio and half-life for a pair-trading study
  • Fitting GARCH(1,1) to daily returns and forecasting annualised volatility for the next several days
  • Running Granger causality tests to see whether lagged volume helps predict returns, with the multiple-testing caveat in mind
  • Learning time-series tests with worked examples drawn from the skill's code

Frequently asked questions

Is the quant-statistics skill free to use?

The skill is published under the MIT licence. The Vibe-Trading repository and the Python packages it uses are separate projects, each with its own licence terms, so check those as well.

What do I need to install before using this skill?

You need the Vibe-Trading repository with src.quantlib.timeseries, Python with numpy and pandas, statsmodels for most tests, and arch if you want GARCH. The skill's requirements list the minimum versions.

Where do I put the skill folder?

Unzip it into ~/.claude/skills/ for a personal install or into .claude/skills/ inside a project. In the Claude apps you can upload it under Settings, Capabilities, Skills.

Why does my ADF or GARCH call say a package is missing?

The functions import statsmodels or arch only when they are called, so a missing package raises an ImportError that names the package. Install it with the pip command shown in the requirements section, then rerun the call.

Can the agent use this skill without the Vibe-Trading repository?

Not as written. The skill calls functions in src.quantlib.timeseries, so without that code the functions cannot be imported. You would need to supply equivalent functions yourself.

How does this compare with writing the statistics myself?

The skill tells the agent to call the library's tested functions rather than retype formulas, which the source says is how sign errors and double-square-root bugs get into results. You still need to understand what the output means before acting on it.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits quant researchers and students who want an agent to run standard stationarity, cointegration, Granger, GARCH and bootstrap checks using tested code, with interpretation rules built in. It is a poor fit for anyone without the Vibe-Trading repository or anyone who would trade real money on the output without understanding p-values, half-lives and the limits of predictive tests.

Download the skill