# Paper-to-Code Mapping
# ๋
ผ๋ฌธ 32๊ฐ ๋ชจ๋๊ณผ ์ฝ๋๋ฒ ์ด์ค ์ฐ๋ ๋งต
## Module #14-16: Data Overview (๋ฐ์ดํฐ ๊ฐ๊ด)
### #14: Context - Quantum Computing Industry
**๋
ผ๋ฌธ ๋ด์ฉ:** ์์์ปดํจํ
์ฐ์
๋ฐฐ๊ฒฝ ์ค๋ช
**์ฝ๋ ์์น:**
- `src/features.py::consolidate_company_snapshots()`
- Filter: `df[df.sector_fe == 'quantum']`
**ํ
์คํธ:**
```python
# test/unit/test_features.py
def test_quantum_sector_filtering():
"""Verify quantum sector companies are correctly identified"""
```
### #15: Sample Construction
**๋
ผ๋ฌธ ๋ด์ฉ:** ํ๋ณธ ๊ตฌ์ฑ (์ถ์ฒ/์ฝํธํธ/ํํฐ)
**์ฝ๋ ์์น:**
- `src/features.py::consolidate_company_snapshots()`
- `src/features.py::engineer_features()`
**์์ฑ ์ํฐํฉํธ:** ๐๏ธ ํ๋ณธ๊ตฌ์ฑํ
**ํ
์คํธ:**
```python
# test/integration/test_sample_construction.py
def test_sample_size_matches_paper():
"""Verify final sample size matches paper Table X"""
df = consolidate_company_snapshots('data/raw')
assert len(df) == PAPER_REPORTED_N
```
### #16: Variables Overview (E/L/V/F)
**๋
ผ๋ฌธ ๋ด์ฉ:**
- E: Early event (Series A at baseline)
- L: Later success (Series B+ at endpoint)
- V: Vagueness score
- F: Flexibility (1 - is_hardware)
**์ฝ๋ ์์น:**
- `src/features.py::engineer_features()`
- `src/vagueness_v2.py::StrategicVaguenessScorerV2`
**์์ฑ ์ํฐํฉํธ:** ๐๏ธ ๋ณ์์ ์ยท์์ฝํต๊ณ
**ํ
์คํธ:**
```python
# test/integration/test_variables.py
def test_table_descriptive_stats():
"""Generate Table X: Descriptive Statistics and compare with paper"""
df = load_and_engineer_features()
stats = df[['E', 'L', 'V', 'F']].describe()
# Compare with paper-reported values
```
---
## Module #17-22: Empirical Methodology (์ค์ฆ ๋ฐฉ๋ฒ๋ก )
### #17: Measurements
**๋
ผ๋ฌธ ๋ด์ฉ:** V (vagueness), F (flexibility) ์ธก์ ๋ฐฉ๋ฒ
**์ฝ๋ ์์น:**
- `src/vagueness_v2.py::StrategicVaguenessScorerV2.score()`
- `src/features.py::engineer_features()` (F = 1 - is_hardware)
**ํ
์คํธ:**
```python
# test/unit/test_vagueness.py
def test_vagueness_measurement_validity():
"""Validate vagueness scoring against hand-coded examples"""
```
### #19: Identification Strategy
**๋
ผ๋ฌธ ๋ด์ฉ:** ๋ด์์ฑ ๋
ผ์, ์๋ณ ์ ๋ต
**์ฝ๋ ์์น:**
- `src/models.py` (์ฃผ์ ์ฐธ์กฐ)
- Controls selection logic
**๋ฌธ์ํ:** `docs/identification_strategy.md`
### #20: Main Specifications
**๋
ผ๋ฌธ ๋ด์ฉ:** E ~ V (OLS), L ~ V ร F (Logit)
**์ฝ๋ ์์น:**
- `src/models.py::run_HEV()` - H1 for E ~ V
- `src/models.py::run_HLVF()` - H2 for L ~ V ร F
**์์ฑ ์ํฐํฉํธ:** ๐๏ธ T_MainSpecs
**ํ
์คํธ:**
```python
# test/integration/test_main_specs.py
def test_h1_specification_matches_paper():
"""Verify H1 formula matches paper equation (X)"""
# Run model
result = run_HEV(df)
# Check formula includes correct controls
assert 'z_V' in result.params
```
---
## Module #23-27: Results (๊ฒฐ๊ณผ)
### #23: H1 - Early Funding Penalty
**๋
ผ๋ฌธ ๋ด์ฉ:** Vagueness reduces early funding
**์ฝ๋ ์์น:**
- `src/models.py::test_h1_early_funding()`
- OR `src/models.py::run_HEV()` (two-snapshot mode)
**์์ฑ ์ํฐํฉํธ:** ๐ผ๏ธ Fig2_EVF, ๐๏ธ T1
**ํ
์คํธ:**
```python
# test/integration/test_paper_results.py
def test_table1_h1_results():
"""Reproduce Table 1: H1 regression coefficients"""
df = load_analysis_data()
result = test_h1_early_funding(df)
# Compare with paper-reported values (with tolerance)
PAPER_COEF_VAGUENESS = -0.234 # From paper Table 1
PAPER_SE = 0.089
assert abs(result.params['z_vagueness'] - PAPER_COEF_VAGUENESS) < 0.01
assert abs(result.bse['z_vagueness'] - PAPER_SE) < 0.01
def test_figure2_evf_plot():
"""Reproduce Figure 2: E-V-F relationship"""
df = load_analysis_data()
fig_path = plot_figure2_evf(df)
# Check file exists and is non-trivial
assert Path(fig_path).exists()
assert Path(fig_path).stat().st_size > 10000
```
### #24: H2 - Later Success Benefit
**๋
ผๆ ๅ
ๅฎน:** Vagueness beneficial for later success (moderated by F)
**์ฝ๋ ์์น:**
- `src/models.py::test_h2_main_growth()`
- OR `src/models.py::run_HLVF()` (two-snapshot mode)
**์์ฑ ์ํฐํฉํธ:** ๐ผ๏ธ Fig3_LVF, Fig4_STV, ๐๏ธ T2
**ํ
์คํธ:**
```python
def test_table2_h2_results():
"""Reproduce Table 2: H2 logit regression"""
df = load_analysis_data()
result = test_h2_main_growth(df)
# Main effect (vagueness)
PAPER_COEF_MAIN = 0.456
assert abs(result.params['z_vagueness'] - PAPER_COEF_MAIN) < 0.01
# Interaction (vagueness ร hardware)
PAPER_COEF_INTERACTION = -0.321
interaction_param = [p for p in result.params.index
if 'z_vagueness' in p and 'is_hardware' in p][0]
assert abs(result.params[interaction_param] - PAPER_COEF_INTERACTION) < 0.01
```
### #25: H2a - VรF Interaction
**๋
ผ๋ฌธ ๋ด์ฉ:** ์ํธ์์ฉ ํจ๊ณผ (flexibility amplifies vagueness benefit)
**์ฝ๋ ์์น:** Same as #24
**์์ฑ ์ํฐํฉํธ:** ๐ผ๏ธ Fig3_LVF (interaction plot)
**ํ
์คํธ:**
```python
def test_figure3_interaction_plot():
"""Reproduce Figure 3: VรF interaction visualization"""
df = load_analysis_data()
result = test_h2_main_growth(df)
# Generate interaction plot
fig_path = plot_figure3_interaction(df, result)
# Visual regression test (compare with reference image)
# assert image_similarity(fig_path, 'test/fixtures/fig3_reference.png') > 0.95
```
### #26: Mechanisms - Pivot/Learning
**๋
ผ๋ฌธ ๋ด์ฉ:** ๋ฉ์ปค๋์ฆ ๋ถ์ (ํผ๋ฒ ๋น๋, ํ์ต ์๋)
**์ฝ๋ ์์น:**
- โ ๏ธ **์๋ก ์์ฑ ํ์:** `src/models.py::test_mechanism_pivot()`
**์์ฑ ์ํฐํฉํธ:** ๐๏ธ T_Mech
**ํ
์คํธ:**
```python
# test/unit/test_mechanisms.py
def test_pivot_frequency_analysis():
"""Mechanism: Companies with higher V pivot more frequently"""
# TODO: Implement pivot detection logic
# df['pivot_count'] = detect_pivots(df)
# model = smf.ols('pivot_count ~ z_vagueness + controls', df).fit()
# assert model.params['z_vagueness'] > 0
```
### #27: Robustness - Spec Curve
**๋
ผ๋ฌธ ๋ด์ฉ:** ๊ฐ๊ฑด์ฑ ๊ฒ์ฆ (์คํ ์ปค๋ธ, ์์ ์ฑ)
**์ฝ๋ ์์น:**
- `src/multiverse.py` (already exists)
**์์ฑ ์ํฐํฉํธ:** ๐๏ธ T_SpecCurve
**ํ
์คํธ:**
```python
# test/integration/test_robustness.py
def test_specification_curve():
"""Run multiverse analysis across 100+ specifications"""
from multiverse import run_specification_curve
results = run_specification_curve(df)
# Check majority of specs support main hypothesis
significant_positive = sum((r.params['z_vagueness'] > 0) & (r.pvalues['z_vagueness'] < 0.05)
for r in results)
assert significant_positive / len(results) > 0.8 # 80%+ support
```
---
## Module #11-13: Conceptual Model (๊ฐ๋
ํ)
### #11: Framework (2ร2)
**๋
ผ๋ฌธ ๋ด์ฉ:** 2ร2 framework (์๊ฐร๋ ๋ฒจ)
**์์ฑ ์ํฐํฉํธ:** ๐ผ๏ธ Fig1_LV (conceptual figure)
**์ฝ๋ ์์น:** Manual illustration (not code-generated)
**๋ฌธ์ํ:** `docs/conceptual_framework.md`
### #13: Hypotheses (H1/H2/H2a)
**๋
ผ๋ฌธ ๋ด์ฉ:** ๊ฐ์ค ์ ์ํ
**์ฝ๋ ์์น:**
- Documented in `src/models.py` docstrings
- Each hypothesis test function has detailed docstring
**ํ
์คํธ:**
```python
# test/meta/test_hypothesis_documentation.py
def test_h1_docstring_matches_paper():
"""Verify H1 docstring matches paper hypothesis statement"""
import inspect
from models import test_h1_early_funding
docstring = inspect.getdoc(test_h1_early_funding)
assert "vagueness reduces early funding" in docstring.lower()
```
---
## Summary Table: Code-Paper Mapping
| Module | ๋
ผ๋ฌธ ์น์
| ์ฝ๋ ํ์ผ | ํ
์คํธ ํ์ผ | ์ํฐํฉํธ | ์ํ |
|--------|----------|----------|------------|---------|-----|
| #14 | Context | features.py | test_features.py | - | โ
|
| #15 | Sample | features.py | test_sample_construction.py | ๐๏ธํ๋ณธ๊ตฌ์ฑ | โ ๏ธ |
| #16 | Variables | features.py, vagueness_v2.py | test_variables.py | ๐๏ธ์์ฝํต๊ณ | โ ๏ธ |
| #17 | Measurements | vagueness_v2.py | test_vagueness.py | - | โ
|
| #20 | Specifications | models.py | test_main_specs.py | ๐๏ธMainSpecs | โ ๏ธ |
| #23 | H1 Results | models.py::test_h1 | test_paper_results.py | ๐ผ๏ธFig2, ๐๏ธT1 | โ ๏ธ |
| #24 | H2 Results | models.py::test_h2 | test_paper_results.py | ๐ผ๏ธFig3-4, ๐๏ธT2 | โ ๏ธ |
| #25 | Interaction | models.py::test_h2 | test_paper_results.py | ๐ผ๏ธFig3 | โ ๏ธ |
| #26 | Mechanisms | models.py (new) | test_mechanisms.py | ๐๏ธT_Mech | โ |
| #27 | Robustness | multiverse.py | test_robustness.py | ๐๏ธSpecCurve | โ |
Legend:
- โ
= ์ฝ๋ & ํ
์คํธ ์๋ฃ
- โ ๏ธ = ์ฝ๋ ์์, ํ
์คํธ ํ์
- โ = ์ฝ๋ or ํ
์คํธ ๋ชจ๋ ํ์