Skip to content

Portfolio cleanup: reproducible S&P 500 vs KOSPI analysis - #1

Merged
Jimin0731 merged 14 commits into
mainfrom
codex/create-new-feature-branch-for-analysis
Aug 6, 2026
Merged

Portfolio cleanup: reproducible S&P 500 vs KOSPI analysis#1
Jimin0731 merged 14 commits into
mainfrom
codex/create-new-feature-branch-for-analysis

Conversation

@Jimin0731

@Jimin0731 Jimin0731 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Rebuild the repository as a focused, reproducible portfolio comparison of S&P 500 (^GSPC) and KOSPI (^KS11) local-currency monthly price indices from January 2000 through December 2024.
  • Correct the original frequency mismatch, personal paths, sector-average mislabelling, stale notebook outputs, and failed forecasting experiments.
  • Keep normal analysis and CI offline after committing a canonical monthly snapshot.

Implemented

  • Added canonical analysis.py functions for monthly returns, normalized performance, calendar-year compounding, annualized geometric price return, annualized volatility, maximum drawdown, positive-month ratio, 12-month rolling volatility, and 36-month rolling return correlation.
  • Added a validated data refresh script, committed monthly snapshot and metadata, machine-readable results, four deterministic UTF-8 SVG figures, README consistency tooling, a presentation notebook, fresh-kernel notebook smoke execution, focused tests, pinned dependencies, and read-only offline CI.
  • Archived the original coursework without modifying the original PDF.
  • Fixed CI import handling and PNG-validation false positives.

Data snapshot

  • Delivery: live Yahoo Finance through yfinance
  • Tickers: ^GSPC and ^KS11
  • Requested window: 1999-12-01 through 2025-01-01
  • Common snapshot: December 1999 through December 2024
  • Snapshot rows: 301
  • Reported monthly observations: 300 per market
  • Missing values: 0
  • SHA-256: d6627cb85439f6dc7724b4d5efbc4ced9ac0ada89f88449bef358bf9a15aeb4f

Key results

Market Annualized geometric price return Annualized volatility Maximum drawdown Positive months Best year Worst year
S&P 500 5.71% 15.30% -52.56% 62.33% 2013: 29.60% 2008: -38.49%
KOSPI 3.45% 21.16% -49.18% 54.67% 2005: 53.96% 2000: -50.92%

The 36-month rolling monthly-return correlation has mean 0.6602, minimum 0.2686, and maximum 0.8400.

Interpretation limits

Results use unadjusted local-currency price indices. Dividends, USD/KRW exchange-rate movements, fees, taxes, inflation, and investor-specific currency conversion are excluded. This is descriptive historical analysis, not a forecast, causal claim, recommendation, trading strategy, or total-return comparison.

Validation status

  • Generated data, all three result files, README values, and all four SVG figures are committed.
  • Snapshot hashes agree across metadata and result files.
  • The earlier pytest failure was caused only by the PNG checker scanning its own deny-list string; that self-reference has been fixed in head 38d6d42c8fc86399c459227347d2ed0c934aa980.
  • The latest GitHub Actions runs are currently queued/pending for final offline validation.

This PR remains draft and unmerged.

@Jimin0731
Jimin0731 marked this pull request as draft August 6, 2026 16:08
@Jimin0731 Jimin0731 closed this Aug 6, 2026
@Jimin0731 Jimin0731 reopened this Aug 6, 2026
@Jimin0731
Jimin0731 marked this pull request as ready for review August 6, 2026 17:31
@Jimin0731
Jimin0731 merged commit 8902e1b into main Aug 6, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant