Przejdź do treści
Biblioteka skilli
Finanse i księgowość · Analiza

regimes

/regimes

Szacuje, w jakim reżimie rynkowym jesteśmy, jako prawdopodobieństwa dla każdego reżimu, z cech zmienności, trendu, obsunięcia i korelacji.

Licencja
MIT
Ostatnia zmiana repozytorium
07.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
3
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 07.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: scripts/regimes.py

Co robi i kiedy

Szacuje, w jakim reżimie rynkowym jesteśmy, jako prawdopodobieństwa dla każdego reżimu, z cech zmienności, trendu, obsunięcia i korelacji.

Oryginalny opis (EN)

Estimates which market regime is in force, as a probability for each regime, from relative features such as the ratio of short to long volatility, trend strength, drawdown, and cross asset correlation, using only data available at each date. Use when asked what kind of market we are in, whether volatility or stress is rising, for regime probabilities, or for exposure that adapts to the regime.

Jak działa

  1. Inputs
  2. Procedure
  3. Checks
  4. Output
  5. Explaining the result
Sekcje z nagłówków SKILL.md, w oryginale · 44 linii, 426 słów
Podgląd SKILL.md
---
name: regimes
description: Estimates which market regime is in force, as a probability for each regime, from relative features such as the ratio of short to long volatility, trend strength, drawdown, and cross asset correlation, using only data available at each date. Use when asked what kind of market we are in, whether volatility or stress is rising, for regime probabilities, or for exposure that adapts to the regime.
license: MIT
compatibility: Requires Python 3.9 or later with numpy and pandas.
metadata:
  owner: research
  version: "1.0"
---

# Regime detection

Answers one question: what kind of market are we in? Fits a Gaussian hidden Markov model (Hamilton, 1989) to relative features and reports filtered probabilities. Every number comes from `scripts/regimes.py`.

## Inputs

- `prices.csv`: a date column, then daily price levels. One column is the series whose regime is measured (for example an equity index). Extra columns, such as bonds, credit, or currencies, feed the average correlation feature.
- At least three years of daily history: one year to warm up the features and enough to train and then report.
- A training end date. The model is fitted only on data up to that date; report dates after it are out of sample. If the user gives none, the script uses the midpoint of the history and flags it.
- Optional: a target exposure for each regime, ordered from lowest to highest volatility. These are the user's own policy. Never propose them yourself.

## Procedure

1. Confirm the series, the correlation series, the number of regimes (2 or 3), and the training end date.
2. Run the model:
   ```bash
   python scripts/regimes.py --prices prices.csv --asset INDEX --states 3 \
     --train-end 2019-12-31 --exposures 1.0,0.6,0.2 --history regimes_history.csv
   ```
3. Read the JSON. If `passed` is false, report the failed check and stop.
4. Report the probability of each regime, the most likely regime, the feature values behind it, and the blended exposure when targets were given.

## Checks

- Probabilities sum to one on every date.
- No future data: probabilities recomputed from prices cut at a check date match the full run exactly.
- The EM fit converged.
- The report date lies after the training period.

## Output

`results.probabilities` (one per regime: `low_vol`, `normal`, `high_vol`, or two of them), `results.most_likely`, `results.features`, `results.regime_means`, `results.transition_matrix`, `results.expected_duration_days`, and with targets `results.blended_exposure`. `--history` writes the daily probabilities to a CSV.

## Explaining the result

- Lead with the probabilities, not only the most likely label; a 55 to 45 split is a different message from 95 to 5.
- Tie the answer to the features: for example, short term volatility running above its one year level with a falling trend and rising correlation.
- Regimes are labeled by their average volatility ratio. Describe them with the `regime_means`, which show what each regime looked like in training.
- Expected duration comes from the transition matrix and describes typical persistence in the training period.
- The blended exposure moves smoothly as probabilities change, which avoids abrupt switches on noisy signals.

For features, the model, and the filter, see [references/methodology.md](references/methodology.md).
Pliki w paczce (3)
  • SKILL.md 3 KB
  • references/methodology.md 2 KB
  • scripts/regimes.py 10 KB

Wersje

W bazie nie ma innych skilli o nazwie regimes.

Migawka bazy z 13.11.2026 · wersja paczki f84eac9d25af (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95ml4t-regime-features
    Buduje cechy opisujące reżim rynku: stan zmienności, siłę trendu i warunki płynności, dla modeli uwzględniających reżimy lub zmienne otoczenie rynkowe.
  • 100market-regime
    Określa bieżący reżim rynkowy: trend i zmienność, sygnały risk-on i risk-off, kontekst makro oraz dopasowanie strategii do reżimu.
  • 100market-regime
    Klasyfikuje reżim rynku dla indeksu, ETF-u lub krypto: od wzrostowego po risk-off, z trendu, momentum, zmienności i sugerowaną ekspozycją.
  • 100crypto-regime
    Odczytuje reżim rynku krypto: trend i obsunięcie BTC, ETH, SOL, zmienność, korelację z Nasdaqiem i pozycje spekulantów w kontraktach CFTC.
  • 95ml4t-regime-awareness
    Traktuje reżimy rynkowe jako cechy warunkujące skalowanie ryzyka, nie jako sygnały wejścia, przy włączaniu detekcji reżimów do logiki strategii.
  • 90cross-asset-correlation-regime-shifts
    Wykrywa moment, w którym obligacje przestają zabezpieczać akcje w portfelu wielu klas aktywów, mierząc odległość macierzy korelacji.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.