Clone
1
Architecture
Variet Main Worker edited this page 2026-03-10 13:56:44 +00:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Lifetime PD — Architecture

시스템 개요

Belkin & Suchower (1998) + Vasicek 단일팩터 모델 기반 50년 Lifetime PD 산출 시스템.

모듈 구조

main.py                          # 7단계 파이프라인 오케스트레이터
├── data/
│   ├── transition_matrices.py   # 한국 3사 신용등급 전이행렬 (builtin + CSV 로더)
│   └── macro_data.py            # BOK ECOS API 거시경제변수 6종 수집
├── models/
│   ├── credit_cycle.py          # Belkin & Suchower Zt 추정 (WLS)
│   ├── vasicek.py               # Vasicek 조건부 PD/전이행렬
│   └── macro_model.py           # Zt~거시 OLS 회귀 (Stepwise AIC)
├── scenarios/
│   └── scenario_engine.py       # 호황/중립/불황 시나리오 + Mean-reversion
├── projection/
│   └── lifetime_pd.py           # 50년 누적/한계 PD + 확률가중평균
├── validation/
│   └── statistical_tests.py     # ADF, Ljung-Box, R², ARCH, PD 성질 검증
├── output/
│   └── visualizer.py            # 차트 7종 + 요약 테이블
├── config.yaml                  # ECOS API 키, 모형 파라미터, 시나리오 설정
└── docs/
    └── methodology.md           # 이론적 방법론 상세 문서

데이터 흐름

전이행렬(26yr) → TTC 평균 → Φ⁻¹ 임계값 → WLS → Zt 시계열
                                                    ↓
ECOS API 거시 6변수 ──→ Stepwise OLS ──→ Zt~거시 회귀
                                                    ↓
시나리오(3종) × 50yr → 조건부 TM → 행렬 곱 → PD term structure

ECOS API 코드 (검증 2026-03-10)

변수 통계표 항목코드 주기
GDP 성장률 902Y015 KOR A
실업률 901Y027 I61BC A
기준금리 722Y001 0101000 A
CD(91일) 721Y001 2010000 A
CPI 901Y009 0 (level→YoY%) A
선행지수 901Y067 I16A M→A avg

기술 스택

  • Python 3.12 (conda: quant)
  • numpy, scipy, pandas, matplotlib, statsmodels, tabulate, requests, pyyaml