Логотип Econometric Diagnostics

Econometric Diagnostics

Организация
bis-med-it
econometric-diagnostics

Residual diagnostics and model adequacy checks for VAR/BVAR models. Use when the orchestrator reaches the diagnostics step of Stage 4 (estimation), whose results feed the Stage 5 sensibility check, or when the user asks to check residuals, test for autocorrelation, heteroskedasticity, normality, or structural breaks.

Обзор

Издательbis-med-it
Репозиторийmarco-BIS
Название навыкаeconometric-diagnostics
Звёзды
28
Форки
6
Файлы в комплекте
Только инструкции
ЛицензияApache-2.0
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — bis-med-it. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Econometric Diagnostics в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/bis-med-it/marco-BIS/tree/main/skills/diagnostics
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bis-med-it/marco-BIS.git /tmp/marco-BIS
mkdir -p .claude/skills
cp -r /tmp/marco-BIS/skills/diagnostics .claude/skills/econometric-diagnostics
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Econometric Diagnostics в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Econometric Diagnostics, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Econometric Diagnostics не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Econometric diagnostics

Tests performed

Built-in bundle. lib.diagnostics(fit) provides:

  • per equation: Ljung-Box (one or more lags), Jarque-Bera and ARCH-LM;
  • system level: the maximum companion-matrix eigenvalue modulus, with a status label (stability);
  • an AIC/BIC/HQ lag-order comparison: it refits an OLS VAR at p = 1..max_lag_search and reports which p each criterion picks.

The other tests below are marked additional. They are not part of the built-in bundle; the agent can run them separately (e.g. via statsmodels) when the question calls for them.

Residual-level diagnostics

For each equation in the VAR system:

  1. Autocorrelation. Ljung-Box test at lags 4, 8, 12 (quarterly) or 6, 12, 24 (monthly). (lib.diagnostics(fit, lb_lags=[...]) computes all requested lags in one call; the report's diagnostics table labels each row with the lag actually used.) Additional: Breusch-Godfrey LM test for the system.
  2. Heteroskedasticity. ARCH-LM test (Engle, 1982) to detect conditional heteroskedasticity. Additional: White test for unconditional heteroskedasticity.
  3. Normality. Jarque-Bera test per equation. Additional: Lomnicki-Jarque-Bera for the system. Note: non-normality is common in macro data and is not a reason to reject the model unless extreme.

System-level diagnostics

  1. Stability. Companion matrix eigenvalues. Report the maximum root and classify the dynamics as stationary (below 1), unit-root (at 1 within sampling error) or explosive (above 1). Apply the declared model-class and replication criteria consistently, treat near-unit-root sampling uncertainty as a disclosed diagnostic, and do not certify stability from finite-horizon plots. (lib.diagnostics reports the maximum modulus; plotting the eigenvalues on the unit circle diagram is an additional step.) Arbitration for LEVELS systems: lib.diagnostics labels any max |eig| ≥ 1.0 "non-stationary / unstable", but a VAR in log-levels (or with a random-walk Minnesota prior) legitimately sits at or just above the unit circle; several canonical replications validate against an expected band like 1.0 ± 0.05. Reconcile in this order: (i) does the spec intend unit-root-like persistence (levels + shrinkage)? then near-1 is expected, not a failure; (ii) apply the Stage-5 standard for the IRFs: responses to transitory shocks should die out and responses to permanent shocks flatten to a finite limit; growth at long horizons is a failure signal, but a flat-looking response within a finite horizon does not show that a root above one is stable; (iii) treat the lib label as a prompt to run checks (i)-(ii) and to disclose the classification, never as an auto-reject or an auto-pass.
  2. Lag-order comparison. AIC, BIC and HQ picks across p = 1..max_lag_search (built in; a pick that differs from the fitted p is listed in the warnings).
  3. Granger causality (additional). Wald tests for block exogeneity. Useful for interpreting the system structure.
  4. Lag exclusion (additional). Joint significance of each lag across all equations.
  5. Set-identified models: acceptance rate. For sign/zero-restriction schemes, track accepted draws / attempts against the canonical run or the entry's expected range (the Uhlig replication validates ~0.06 ± 0.04). Low acceptance or a missed target_accepted quota is a computational and precision warning. Acceptance depends on the number of variables, the restrictions, the proposal measure and the sampler, so compare like with like, inspect the accepted and effective draw counts, and check stability separately. Do not infer invalid restrictions from a universal acceptance threshold, and do not silently report results from too few accepted draws.

Structural break detection (optional, additional)

  1. CUSUM and CUSUM-of-squares tests.
  2. If the sample is long, consider a split-sample stability check at known break dates (e.g., 1979Q4 for Volcker, 2008Q3 for GFC).

Scope note: statistical vs economic anomalies. This skill covers the statistical gate. Economic anomalies (price puzzle, wrong-signed responses, implausible magnitudes) are Stage-5 territory: the remedy ladder lives in skills/specification/SKILL.md §"Iterative revision after failed sensibility checks". Go there, not here, when the numbers are statistically clean but economically wrong.

Output format

For the research log, record lib.diagnostics(...).to_log_dict(), plus any additional tests run separately and the agent's recommendation:

diagnostics:
  residuals:                                  # keyed by variable name
    M1:
      ljung_box: {4: {stat, p_value}, 8: ..., 12: ...}   # keyed by lag
      jarque_bera_stat, jarque_bera_pvalue
      arch_stat, arch_pvalue
      breusch_godfrey: {stat, p_value}        # additional; only if run separately
  stability: {max_eigenvalue_modulus, stable: bool, status}   # status: stationary | marginal (near unit root) | non-stationary / unstable
  lag_selection: {current_p, max_lag_search, aic_recommended, bic_recommended, hqic_recommended}
  portmanteau: {stat, p_value, lags}          # additional; only if run separately
  eigenvalues: list of complex numbers        # additional; only if run separately
  warnings:                                   # lib.diagnostics(...).warnings
    - "Autocorrelation detected in M1 equation at lag 4 (p=0.02)"
    - "ARCH effects in GNP deflator equation"
  recommendation: "Consider increasing lag order or adding conditional heteroskedasticity"   # written by the agent; not a lib field

For the report, do not build the table by hand. VARReport.add_standard_sections passes the fit's DiagnosticReport through the report layer's adapter (_build_diagnostics_dict_from_report in scripts/lib/report.py). A direct call to VARReport.add_diagnostics takes a reduced view, keyed by variable name with numeric Ljung-Box lags:

yaml
per_equation:
  M1:
    ljung_box:
      4: {p_value: 0.30}
      8: {p_value: 0.40}
    arch_lm: {p_value: 0.50}
    jarque_bera: {p_value: 0.60}
system:
  stability:
    max_eigenvalue_modulus: 0.90
    note: stationary

Additional tests, warnings and recommendations stay in the log; the report table shows only these fields.

Propose → confirm (handing back to Stage 5 / Stage 4)

When presenting results to the user, lead with whether the model passes or fails in plain language. Diagnostics never silently re-specifies the model. On a critical failure (instability, or severe autocorrelation indicating misspecification):

  1. State the failed test in plain language and why it matters economically, e.g. "the companion matrix has a root at 1.02, so the VAR is explosive and impulse responses won't die out."
  2. Propose one specific remedy with rationale, drawn from the usual levers (+1 lag, reorder / add a variable, tighten the prior, shorten the sample), e.g. "I propose adding a 5th lag; the Ljung-Box failure at lag 4 points to unmodelled own dynamics."
  3. Wait for the user to confirm or override before routing back to Stage 4 for re-estimation. (The orchestrator's 5-iteration automatic budget covers only implementation/data-error fixes and pre-specified statistical rules; economically substantive revisions like this one are each gated.)

For soft warnings (mild non-normality, marginal ARCH), state them and recommend proceeding; don't block. Either way the flag and its disposition are logged via the research-log skill. Never auto-respecify without surfacing the choice. This is design principle 3 (active suggestion, human confirmation) applied to diagnostics.

Часто задаваемые вопросы

Что делает навык ИИ Econometric Diagnostics?

Residual diagnostics and model adequacy checks for VAR/BVAR models. Use when the orchestrator reaches the diagnostics step of Stage 4 (estimation), whose results feed the Stage 5 sensibility check, or when the user asks to check residuals, test for autocorrelation, heteroskedasticity, normality, or structural breaks.

Зачем использовать Econometric Diagnostics в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Econometric Diagnostics — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Econometric Diagnostics в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/bis-med-it/marco-BIS/tree/main/skills/diagnostics. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Econometric Diagnostics?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Econometric Diagnostics?

С любым количеством. В TypingMind вы можете использовать Econometric Diagnostics с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Econometric Diagnostics?

Да. Навык опубликован на GitHub по лицензии Apache-2.0. Издатель — bis-med-it. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇