Skill: tangweigang-jpg/credit-transition-matrix (version 0.3.3)

--- name: credit-transition-matrix description: |- 处理信用评级转移矩阵，支持Not-Rated状态重分配、年度与月度矩阵转换、状态空间定义及数据集表征。 license: Proprietary. See LICENSE.txt in project root. compatibility: Designed for Doramagic-host ecosystem (Claude Code / openclaw / Cursor). Requires Python 3.12+ with uv package manager. metadata: version: "v6.1" blueprint_id: "finance-bp-119" compiled_at: "2026-04-22T13:00:58.228711+00:00" capability_markets: "global" capability_activities: "credit-risk" sop_version: "crystal-compilation-v6.1" --- # 信用转移矩阵 (credit-transition-matrix) > 处理信用评级转移矩阵，支持Not-Rated状态重分配、年度与月度矩阵转换、状态空间定义及数据集表征。 ## Pipeline `data_collection -> data_storage -> factor_computation -> target_selection -> trading_execution -> visualization` ## Top Use Cases (22 total) ### Adjust Not-Rated State in Credit Migration Matrices (`UC-101`) Credit rating transition matrices often contain 'not-rated' (NR) observations that need to be redistributed to rated states for downstream risk calcul **Triggers**: not-rated, NR adjustment, credit migration ### Adjust Not-Rated State via Python Script (`UC-104`) Corporate credit rating migration data contains NR (not-rated) states that must be removed using noninformative redistribution method before calculati **Triggers**: not-rated, NR removal, credit rating ### Clean and Prepare Transition Data (`UC-108`) Raw credit rating data requires preprocessing including column renaming, state validation, and absorbing state verification before it can be used for **Triggers**: data cleaning, preprocessing, validation For all **22** use cases, see [references/USE_CASES.md](references/USE_CASES.md). **Execute trigger**: `When user intent matches intent_router.uc_entries[].positive_terms AND user uses action verb (run/execute/跑/执行/backtest/fetch/collect)` ## What I'll Ask You - Target market: A-share (default), HK, or crypto? (US stocks in ZVT are half-baked — stockus_nasdaq_AAPL exists but coverage is thin) - Data source / provider: eastmoney (free, no account), joinquant (account+paid), baostock (free, good history), akshare, or qmt (broker)? - Strategy type: MACD golden-cross, MA crossover, volume breakout, fundamental screen, or custom factor? - Time range: start_timestamp and end_timestamp for backtest period - Target entity IDs: specific stocks (stock_sh_600000) or index components (SZ1000)? ## Semantic Locks (Fatal) | ID | Rule | On Violation | |---|---|---| | `SL-01` | Execute sell orders before buy orders in every trading cycle | halt | | `SL-02` | Trading signals MUST use next-bar execution (no look-ahead) | halt | | `SL-03` | Entity IDs MUST follow format entity_type_exchange_code | halt | | `SL-04` | DataFrame index MUST be MultiIndex (entity_id, timestamp) | halt | | `SL-05` | TradingSignal MUST have EXACTLY ONE of: position_pct, order_money, order_amount | halt | | `SL-06` | filter_result column semantics: True=BUY, False=SELL, None/NaN=NO ACTION | halt | | `SL-07` | Transformer MUST run BEFORE Accumulator in factor pipeline | halt | | `SL-08` | MACD parameters locked: fast=12, slow=26, signal=9 | halt | Full lock definitions: [references/LOCKS.md](references/LOCKS.md) ## Top Anti-Patterns (14 total) - **`AP-CREDIT-RISK-001`**: Empty DataFrame passed to bucketing pipeline - **`AP-CREDIT-RISK-002`**: Multi-dimensional target array causing WoE shape mismatch - **`AP-CREDIT-RISK-003`**: OptimalBucketer receiving high-cardinality numerical features All 14 anti-patterns: [references/ANTI_PATTERNS.md](references/ANTI_PATTERNS.md) ## Evidence Quality Notice > [QUALITY NOTICE] This crystal was compiled from blueprint finance-bp-119. Evidence verify ratio = 35.8% and audit fail total = 15. Generated results may have uncaptured requirement gaps. Verify critical decisions against source files (LATEST.yaml / LATEST.jsonl). ## Reference Files | File | Contents | When to Load | |---|---|---| | [references/seed.yaml](references/seed.yaml) | V6+ 全量权威 (source-of-truth) | 有行为/决策争议时必读 | | [references/ANTI_PATTERNS.md](references/ANTI_PATTERNS.md) | 14 条跨项目反模式 | 开始实现前 | | [references/WISDOM.md](references/WISDOM.md) | 跨项目精华借鉴 | 架构决策时 | | [references/CONSTRAINTS.md](references/CONSTRAINTS.md) | domain + fatal 约束 | 规则冲突时 | | [references/USE_CASES.md](references/USE_CASES.md) | 全量 KUC-* 业务场景 | 需要完整示例时 | | [references/LOCKS.md](references/LOCKS.md) | SL-* + preconditions + hints | 生成回测/交易代码前 | | [references/COMPONENTS.md](references/COMPONENTS.md) | AST 组件地图（按 module 拆分）| 查 API 时 | --- *Compiled by Doramagic crystal-compilation-v6.1 from `finance-bp-119` blueprint at 2026-04-22T13:00:58.228711+00:00.* *See [human_summary.md](human_summary.md) for non-technical overview.*

path: human_summary.md
content: # Human Summary

> I help you build quant strategies on A-share with ZVT — from data fetch to backtest, one flow. Just tell me what you want; I'll write the code, you don't have to dig docs. (Heads up: ZVT natively supports A-share, HK, and crypto. US stocks — stockus_nasdaq_AAPL — are half-baked; don't bother for serious work.)

## What I Can Do

- **tagline**: I help you build quant strategies on A-share with ZVT — from data fetch to backtest, one flow. Just tell me what you want; I'll write the code, you don't have to dig docs. (Heads up: ZVT natively supports A-share, HK, and crypto. US stocks — stockus_nasdaq_AAPL — are half-baked; don't bother for serious work.)
- **use_cases**: ['Convert Annual to Monthly Transition Matrices via Generator', 'Transition Matrix Operations Demonstration', 'Adjust Not-Rated State in Credit Migration Matrices', 'A-share MACD daily golden-cross backtest with hfq price adjustment from eastmoney', 'End-to-end ZVT pipeline: FinanceRecorder + GoodCompanyFactor + StockTrader', 'Multi-factor strategy with TargetSelector (AND mode) combining MACD + volume breakout', 'Index composition data collection (SZ1000, SZ2000) with EM recorder']

## What I Ask You

- Target market: A-share (default), HK, or crypto? (US stocks in ZVT are half-baked — stockus_nasdaq_AAPL exists but coverage is thin)
- Data source / provider: eastmoney (free, no account), joinquant (account+paid), baostock (free, good history), akshare, or qmt (broker)?
- Strategy type: MACD golden-cross, MA crossover, volume breakout, fundamental screen, or custom factor?
- Time range: start_timestamp and end_timestamp for backtest period
- Target entity IDs: specific stocks (stock_sh_600000) or index components (SZ1000)?


path: references/ANTI_PATTERNS.md
content: # Anti-Patterns (Cross-Project)

Total: **14**

## finance-bp-050--skorecard (5)

### `AP-CREDIT-RISK-001` — Empty DataFrame passed to bucketing pipeline <sub>(high)</sub>

When preparing input data for bucketing, passing an empty DataFrame with zero rows or zero columns causes immediate ValueError at validation stage. This prevents any downstream processing and blocks the entire credit risk scoring pipeline from executing. The root cause is missing defensive validation before data enters the bucketing workflow.

### `AP-CREDIT-RISK-002` — Multi-dimensional target array causing WoE shape mismatch <sub>(high)</sub>

When providing target variable y to bucketers without normalizing to 1D numpy array through _check_y validation, downstream Weight of Evidence calculations fail with shape mismatches. The consequence is corrupted bucket tables with incorrect credit risk scores that misrepresent default probability estimates.

### `AP-CREDIT-RISK-003` — OptimalBucketer receiving high-cardinality numerical features <sub>(high)</sub>

When implementing prebucketing for OptimalBucketer on numerical features without reducing to at most 100 unique values, the system raises NotPreBucketedError and blocks the entire bucketing pipeline. Similarly, AsIsNumericalBucketer fails with the same error for columns exceeding 100 unique values, preventing feature transformation in production scoring.

### `AP-CREDIT-RISK-004` — Special values distorting optimal bin boundaries <sub>(high)</sub>

When implementing fit() for bucketers without filtering special values from X before computing bin boundaries using _filter_specials_for_fit(), outlier special values distort optimal bin boundaries. This causes incorrect weight-of-evidence calculations and unreliable credit risk scores that misrepresent borrower default probabilities.

### `AP-CREDIT-RISK-005` — Two-phase bucketing ordering violation causing special value loss <sub>(high)</sub>

When fitting a BucketingProcess with two-phase bucketing without fitting prebucketing_pipeline before bucketing_pipeline, special value remapping fails because pre-bucket labels are unavailable. Additionally, not using _find_remapped_specials() after prebucketing causes special values to lose their correct bucket mappings, resulting in runtime errors.

## finance-bp-072--lending (3)

### `AP-CREDIT-RISK-006` — Loan amount exceeding product and collateral limits <sub>(high)</sub>

When validating loan amount for loan applications without enforcing loan_amount does not exceed maximum_loan_amount from loan product or proposed securities, disbursing amounts exceeding product or collateral limits exposes the lender to uncollateralized risk. This violates lending policy and creates direct financial loss exposure through unauthorized lending.

### `AP-CREDIT-RISK-007` — Disbursement validation failures creating unauthorized exposure <sub>(high)</sub>

When implementing loan disbursement validation without checking disbursed amount against loan limit, assigned security value, available limit amount, and limit applicability dates, unauthorized disbursements occur. For Line of Credit loans, disbursement outside approved periods or exceeding available limits creates unauthorized lending exposure and regulatory compliance violations.

### `AP-CREDIT-RISK-008` — Interest accrual on written-off loans inflating income <sub>(high)</sub>

When processing interest accrual for Written Off loans without verifying posting_date is on or after the loan write-off date, interest is artificially inflated on non-performing assets. This misrepresents loan portfolio value, violates provisioning requirements, and creates false income reporting that misleads stakeholders about actual financial performance.

## finance-bp-112--openLGD (2)

### `AP-CREDIT-RISK-009` — Loop index errors in federated parameter averaging <sub>(high)</sub>

When implementing federated parameter averaging logic, using the final index n instead of the loop variable k causes only the last server's weight to be applied repeatedly. Additionally, skipping the first server by starting loop index at 1 excludes valid parameters from averaging, breaking federated convergence and producing incorrect LGD estimates across all nodes.

### `AP-CREDIT-RISK-010` — API response format inconsistency breaking federated coordination <sub>(high)</sub>

When implementing GET /start and POST /update endpoints for LGD estimation without consistent 'intercept' and 'coefficient' keys in JSON responses, the federated coordinator fails to parse responses causing KeyError. Different return key names (e.g., 'coef' instead of 'coefficient') break both standalone and federated execution paths.

## finance-bp-119--transitionMatrix (4)

### `AP-CREDIT-RISK-011` — Invalid transition probabilities corrupting Markov matrices <sub>(high)</sub>

When generating synthetic Markov chain data or estimating transition matrices with probabilities outside [0, 1] or row sums not equal to 1.0, the resulting matrices violate the fundamental mathematical definition of a stochastic transition matrix. This corrupts all downstream Markov chain modeling and credit curve generation, producing unreliable credit risk estimates.

### `AP-CREDIT-RISK-012` — Unsorted event data causing incorrect transition matrix estimates <sub>(high)</sub>

When feeding generated data to cohort or duration estimators without sorting by entity ID first, then by ascending time, incorrect timepoint assignment occurs in estimators, leading to wrong transition counts. Unsorted data also causes the Aalen-Johansen algorithm to process events out of temporal order, producing incorrect transition matrices that violate the Markov property.

### `AP-CREDIT-RISK-013` — Zero-count division causing NaN in transition matrices <sub>(high)</sub>

When normalizing counts to produce transition probabilities without checking source state population count is greater than zero before division, division by zero occurs and causes NaN values in the transition matrix. These NaN values corrupt all downstream matrix operations including generator matrix computation and credit curve generation.

### `AP-CREDIT-RISK-014` — Wrong matrix logarithm method producing invalid generator matrices <sub>(medium)</sub>

When implementing generator() method without using scipy.linalg.logm for matrix logarithm computation, using numpy.log or other approximation methods produces invalid generator matrices with row sums not equal to zero. This violates the mathematical definition of an infinitesimal generator, causing incorrect continuous-time Markov chain modeling.


path: references/COMPONENTS.md
content: # Component Capability Map

**Project**: finance-bp-119--transitionMatrix
**Scan date**: 2026-04-22
**Stats**: {'total_files': 7, 'total_classes': 32, 'total_functions': 0, 'total_stages': 7}

## Modules (7)

- [state_space_definition](components/state_space_definition.md): 2 classes
- [data_preprocessing](components/data_preprocessing.md): 5 classes
- [synthetic_data_generation](components/synthetic_data_generation.md): 4 classes
- [matrix_estimation](components/matrix_estimation.md): 5 classes
- [matrix_representation](components/matrix_representation.md): 6 classes
- [matrix_operations](components/matrix_operations.md): 7 classes
- [credit_curve_analysis](components/credit_curve_analysis.md): 3 classes


path: references/CONSTRAINTS.md
content: # Constraints

## preservation_manifest

```yaml
required_objects:
  business_decisions_count: 131
  fatal_constraints_count: 46
  non_fatal_constraints_count: 147
  use_cases_count: 22
  semantic_locks_count: 12
  preconditions_count: 4
  evidence_quality_rules_count: 2
  traceback_scenarios_count: 5

```


path: references/LOCKS.md
content: # Semantic Locks + Preconditions

## Semantic Locks (12)

### `SL-01` <sub>(on_violation: fatal)</sub>
Execute sell orders before buy orders in every trading cycle

### `SL-02` <sub>(on_violation: fatal)</sub>
Trading signals MUST use next-bar execution (no look-ahead)

### `SL-03` <sub>(on_violation: fatal)</sub>
Entity IDs MUST follow format entity_type_exchange_code

### `SL-04` <sub>(on_violation: fatal)</sub>
DataFrame index MUST be MultiIndex (entity_id, timestamp)

### `SL-05` <sub>(on_violation: fatal)</sub>
TradingSignal MUST have EXACTLY ONE of: position_pct, order_money, order_amount

### `SL-06` <sub>(on_violation: fatal)</sub>
filter_result column semantics: True=BUY, False=SELL, None/NaN=NO ACTION

### `SL-07` <sub>(on_violation: fatal)</sub>
Transformer MUST run BEFORE Accumulator in factor pipeline

### `SL-08` <sub>(on_violation: fatal)</sub>
MACD parameters locked: fast=12, slow=26, signal=9

### `SL-09` <sub>(on_violation: warning)</sub>
Default transaction costs: buy_cost=0.001, sell_cost=0.001, slippage=0.001

### `SL-10` <sub>(on_violation: fatal)</sub>
A-share equity trading is T+1 (no same-day close of buy positions)

### `SL-11` <sub>(on_violation: fatal)</sub>
Recorder subclass MUST define provider AND data_schema class attributes

### `SL-12` <sub>(on_violation: fatal)</sub>
Factor result_df MUST contain either 'filter_result' OR 'score_result' column

## Preconditions (4)

- **`PC-01`**: `python3 -c 'import zvt; print(zvt.__version__)'` → on_fail: Run: python3 -m pip install zvt then re-run: python3 -m zvt.init_dirs to initialize data directories
- **`PC-02`**: `python3 -c "from zvt.api.kdata import get_kdata; df = get_kdata(entity_ids=['stock_sh_600000'], limit=1); assert df is not None and len(df) > 0, 'No kdata found'"` → on_fail: Run recorder first: python3 -m zvt.recorders.em.em_stock_kdata_recorder --entity_ids stock_sh_600000 (replace with your target entity IDs)
- **`PC-03`**: `python3 -c "import os; from pathlib import Path; zvt_home = Path(os.environ.get('ZVT_HOME', Path.home() / '.zvt')); assert zvt_home.exists(), f'ZVT home not found: {zvt_home}'"` → on_fail: Run: python3 -m zvt.init_dirs
- **`PC-04`**: `python3 -c "import os, tempfile; from pathlib import Path; zvt_home = Path(os.environ.get('ZVT_HOME', Path.home() / '.zvt')); test_f = zvt_home / '.write_test'; test_f.touch(); test_f.unlink()"` → on_fail: Check directory permissions: chmod u+w ~/.zvt or set ZVT_HOME environment variable to a writable location


path: references/USE_CASES.md
content: # Known Use Cases (KUC)

Total: **22**

## `KUC-101`
**Source**: `examples/notebooks/Adjust_NotRated_State.ipynb`

Credit rating transition matrices often contain 'not-rated' (NR) observations that need to be redistributed to rated states for downstream risk calculations and regulatory reporting.

## `KUC-102`
**Source**: `examples/notebooks/Matrix_Operations.ipynb`

Users need to understand how to initialize, validate, and work with transition matrices for credit risk modeling.

## `KUC-103`
**Source**: `examples/notebooks/Monthly_from_Annual.ipynb`

Credit risk models require transition matrices at different time horizons (monthly, quarterly, annual) but only annual matrices may be available; matrix exponentiation of generators enables temporal scaling.

## `KUC-104`
**Source**: `examples/python/adjust_nr_state.py`

Corporate credit rating migration data contains NR (not-rated) states that must be removed using noninformative redistribution method before calculating regulatory capital requirements.

## `KUC-105`
**Source**: `examples/python/characterize_datasets.py`

Data scientists need to understand the characteristics of credit rating transition datasets before applying estimation methods or building models.

## `KUC-106`
**Source**: `examples/python/compare_estimators.py`

Different transition matrix estimation methods produce different results; researchers need to compare cohort-based vs duration-based (Aalen-Johansen) estimators to choose appropriate methods for their data.

## `KUC-107`
**Source**: `examples/python/credit_curves.py`

Credit risk management requires visualization of how default probabilities and credit quality evolve over time through multi-period transition matrices.

## `KUC-108`
**Source**: `examples/python/data_cleaning_example.py`

Raw credit rating data requires preprocessing including column renaming, state validation, and absorbing state verification before it can be used for matrix estimation.

## `KUC-109`
**Source**: `examples/python/deterministic_paths.py`

Testing and validation of transition matrix estimators requires reproducible deterministic transition paths with known outcomes.

## `KUC-110`
**Source**: `examples/python/empirical_transition_matrix.py`

Credit risk modeling requires empirical transition matrix estimation from continuous-time duration data where observation times vary across entities.

## `KUC-111`
**Source**: `examples/python/estimate_matrix.py`

Complete workflow for estimating credit rating transition matrices from historical data using multiple estimation approaches with generator extraction.

## `KUC-112`
**Source**: `examples/python/fix_multiperiod_matrix.py`

Historical credit migration matrices may have structural issues (non-square, missing states, negative probabilities) that must be corrected before use in risk models.

## `KUC-113`
**Source**: `examples/python/generate_full_multiperiod_set.py`

Risk models require complete transition matrices across each time horizons; sparse historical observations must be expanded using matrix exponentiation.

## `KUC-114`
**Source**: `examples/python/generate_synthetic_data.py`

Development and testing of transition matrix estimators requires synthetic data with known properties for validation and benchmarking.

## `KUC-115`
**Source**: `examples/python/generate_visuals.py`

Stakeholders require visual representations of credit migration patterns including Sankey diagrams, heatmaps, and step plots for reporting and presentations.

## `KUC-116`
**Source**: `examples/python/matrix_from_cohort_data.py`

Credit rating agencies publish migration data in cohort format; estimation from this data format requires cohort-based transition matrix estimation.

## `KUC-117`
**Source**: `examples/python/matrix_from_duration_data.py`

Individual credit observations with varying timestamps require duration-based transition matrix estimation using time-to-event methodology.

## `KUC-118`
**Source**: `examples/python/matrix_lendingclub.py`

Peer-to-peer lending platforms like LendingClub have unique grade states; requires specialized transition matrix estimation from loan performance data.

## `KUC-119`
**Source**: `examples/python/matrix_operations.py`

Transition matrices require various mathematical operations including power, validation, printing, and generator extraction for risk calculations.

## `KUC-120`
**Source**: `examples/python/matrix_set_lendingclub.py`

P2P lending risk models require transition matrix sets across multiple periods to capture evolving loan portfolio behavior over time.

## `KUC-121`
**Source**: `examples/python/matrix_set_operations.py`

Multi-period risk models require operations on collections of transition matrices including copying, power-based cumulation, and validation.

## `KUC-122`
**Source**: `examples/python/state_space_operations.py`

Different credit rating agencies use different rating scales; users need to convert between S&P, Moody's, DBRS and other rating systems for portfolio analysis.


path: references/WISDOM.md
content: # Cross-Project Wisdom

Total: **8**

## `CW-CREDIT-RISK-001` — Strict input DataFrame schema validation
**From**: finance-bp-050--skorecard, finance-bp-112--openLGD · **Applicable to**: credit-risk

Both skorecard and openLGD require strict validation that input DataFrames contain exactly the expected columns (X/Y for openLGD, specified variable names for skorecard). This pattern is critical when data flows through multiple transformation stages where downstream modules access columns by name without defensive checking. Always validate column existence before pipeline execution.

## `CW-CREDIT-RISK-002` — Explicit random_state for ML model reproducibility
**From**: finance-bp-112--openLGD · **Applicable to**: credit-risk

In federated learning scenarios with SGDRegressor, omitting random_state causes non-deterministic results due to random data shuffling and weight initialization. This breaks federated learning convergence guarantees. Always set random_state explicitly when reproducibility across nodes or runs is required for regulatory auditability.

## `CW-CREDIT-RISK-003` — Mandatory data sorting before multi-stage estimation
**From**: finance-bp-050--skorecard, finance-bp-119--transitionMatrix · **Applicable to**: credit-risk

Both skorecard's two-phase bucketing and transitionMatrix's Aalen-Johansen estimator require data to be in a specific order before processing. Skorecard requires prebucketing before bucketing; transitionMatrix requires sorting by entity ID then time. Violating this ordering produces incorrect results or runtime errors. Always establish and enforce processing order in multi-stage pipelines.

## `CW-CREDIT-RISK-004` — Consistent API response key naming across all endpoints
**From**: finance-bp-112--openLGD · **Applicable to**: credit-risk

In federated systems with multiple API endpoints (/start, /update), all responses must use identical key names for parameters (intercept, coefficient). Inconsistency causes coordination loop failures in downstream consumers. Define a schema contract upfront and enforce key naming consistency across all response types.

## `CW-CREDIT-RISK-005` — Cardinality bounds checking before array operations
**From**: finance-bp-050--skorecard, finance-bp-119--transitionMatrix · **Applicable to**: credit-risk

Both skorecard's bucketers (max 100 unique values) and transitionMatrix's matrix operations (state cardinality matching matrix dimensions) require strict cardinality validation before creating numpy arrays or performing computations. Violations cause NotPreBucketedError or index out-of-bounds errors. Always validate cardinality constraints before array initialization.

## `CW-CREDIT-RISK-006` — Financial validation gates before transaction execution
**From**: finance-bp-072--lending · **Applicable to**: credit-risk

Lending systems require validation that disbursement amounts do not exceed limits, collateral values, or authorized periods before any transaction executes. These are financial loss prevention controls, not optional business logic. Missing these validations creates unauthorized exposure and regulatory compliance violations that cannot be remedied retroactively.

## `CW-CREDIT-RISK-007` — Mathematical constraint validation for probability outputs
**From**: finance-bp-050--skorecard, finance-bp-119--transitionMatrix · **Applicable to**: credit-risk

Credit risk models must validate mathematical constraints on outputs: skorecard's WoE requires valid bin assignments, transitionMatrix's transition matrices require row sums equals 1.0 and generator matrices require row sums equals 0.0. Invalid mathematical properties corrupt downstream risk calculations. Validate constraints before returning results.

## `CW-CREDIT-RISK-008` — Port-to-ID mapping consistency in distributed model serving
**From**: finance-bp-112--openLGD · **Applicable to**: credit-risk

When deploying distributed model servers, port numbers must map deterministically to server IDs (e.g., port 5001 maps to server ID 1). Computation of ID from port must be consistent across all components. Inconsistencies cause incorrect data directory selection and model parameter mismatches. Document and validate port-ID mappings during deployment.


path: references/components/credit_curve_analysis.md
content: # credit_curve_analysis (3 classes)

## `CreditCurve.default_curves`
`credit_curve_analysis/creditcurve-default-curves.py:0`

## `CreditCurve.validate`
`credit_curve_analysis/creditcurve-validate.py:0`

## `absorbing_state_detection`
`credit_curve_analysis/absorbing-state-detection.py:0`


path: references/components/data_preprocessing.md
content: # data_preprocessing (5 classes)

## `to_canonical`
`data_preprocessing/to-canonical.py:0`

## `to_compact`
`data_preprocessing/to-compact.py:0`

## `bin_timestamps`
`data_preprocessing/bin-timestamps.py:0`

## `generate_cohort_bounds`
`data_preprocessing/generate-cohort-bounds.py:0`

## `cohort_assignment`
`data_preprocessing/cohort-assignment.py:0`


path: references/components/matrix_estimation.md
content: # matrix_estimation (5 classes)

## `BaseEstimator.fit`
`matrix_estimation/baseestimator-fit.py:0`

## `CohortEstimator.fit`
`matrix_estimation/cohortestimator-fit.py:0`

## `AalenJohansenEstimator.fit`
`matrix_estimation/aalenjohansenestimator-fit.py:0`

## `confidence_interval_method`
`matrix_estimation/confidence-interval-method.py:0`

## `estimator_type`
`matrix_estimation/estimator-type.py:0`


path: references/components/matrix_operations.md
content: # matrix_operations (7 classes)

## `TransitionMatrix.generator`
`matrix_operations/transitionmatrix-generator.py:0`

## `TransitionMatrix.power`
`matrix_operations/transitionmatrix-power.py:0`

## `TransitionMatrixSet.cumulate`
`matrix_operations/transitionmatrixset-cumulate.py:0`

## `TransitionMatrixSet.incremental`
`matrix_operations/transitionmatrixset-incremental.py:0`

## `TransitionMatrix.remove`
`matrix_operations/transitionmatrix-remove.py:0`

## `TransitionMatrixSet.default_curves`
`matrix_operations/transitionmatrixset-default-curves.py:0`

## `generator_fix_negative`
`matrix_operations/generator-fix-negative.py:0`


path: references/components/matrix_representation.md
content: # matrix_representation (6 classes)

## `TransitionMatrix.validate`
`matrix_representation/transitionmatrix-validate.py:0`

## `TransitionMatrix.fix_rowsums`
`matrix_representation/transitionmatrix-fix-rowsums.py:0`

## `TransitionMatrix.characterize`
`matrix_representation/transitionmatrix-characterize.py:0`

## `TransitionMatrixSet.to_json`
`matrix_representation/transitionmatrixset-to-json.py:0`

## `validation_accuracy`
`matrix_representation/validation-accuracy.py:0`

## `matrix_set_method`
`matrix_representation/matrix-set-method.py:0`


path: references/components/state_space_definition.md
content: # state_space_definition (2 classes)

## `StateSpace.get_states`
`state_space_definition/statespace-get-states.py:0`

## `state_inference_strategy`
`state_space_definition/state-inference-strategy.py:0`


path: references/components/synthetic_data_generation.md
content: # synthetic_data_generation (4 classes)

## `exponential_transitions`
`synthetic_data_generation/exponential-transitions.py:0`

## `markov_chain`
`synthetic_data_generation/markov-chain.py:0`

## `long_format`
`synthetic_data_generation/long-format.py:0`

## `time_distribution`
`synthetic_data_generation/time-distribution.py:0`


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)