This repository contains a collection of Python scripts and data files for analyzing Bitcoin price trends, exploring investment strategies, and understanding the relationship between community growth and market trends.
Dashboard
Explore the key charts and visualizations from the btcgraphs project. The dashboard is updated daily:
🔬 NEW: Bitcoin Growth Is NOT Slowing Down!
Major Discovery (November 2025): After analyzing 15+ years of Bitcoin data, we discovered that Bitcoin's growth rate is NOT decaying as previously theorized. Instead, it shows cyclical regime shifts, with the recent ETF era (2022-2025) showing the highest growth rate ever recorded (6.874)!
📊 Complete Interactive Report
Full analysis with plain-English explanations, interactive visualizations, and comprehensive methodology
Open Full Report🔬 Individual Statistical Tests (With Plain-English Explanations)
Each visualization includes "How to Read This Chart" guidance, key insights, and practical implications for non-statisticians.
📈 Structural Breaks (Chow Test)
Tests if Bitcoin's growth pattern fundamentally changed at major events. 9 out of 10 events show strong statistical evidence of change.
⚡ Event Impacts
Quantifies exactly how much each event changed Bitcoin's growth rate. Crashes can actually accelerate growth!
📊 What The Data Shows (Click to expand)
❌ Theory Said: Bitcoin growth is slowing down
The theory predicted Bitcoin's power law exponent would decay at ~0.02 per year due to market saturation.
✅ Data Shows: Growth is accelerating!
| Era | Growth Rate (β) | What Happened |
|---|---|---|
| Early (2010-2013) | 6.355 | Early adopters, high volatility |
| Mt.Gox Era (2014-2017) | 3.740 | Post-crash recovery (lowest) |
| Institutional (2018-2021) | 6.189 | Big players enter market |
| ETF Era (2022-2025) | 6.874 ⭐ | Highest on record! |
🔍 Key Insights:
- No Saturation: Exponent increased +0.519 from early to late period (opposite of decay!)
- Events Matter: 9 out of 10 major events (halvings, ETF, crashes) caused structural breaks
- Scale-Invariant: Same pattern across daily, weekly, and monthly data (proves it's fundamental)
- Best Model: Piecewise regime model (R² = 0.9708) beats constant exponent
💡 What This Means:
- 📈 For Investors: Bitcoin growth is not slowing - ETF era shows acceleration
- 🎯 For Predictions: Use regime-specific models, watch for major events
- 🔬 For Theory: Market saturation hypothesis needs revision
👉 Read More: Complete Methodology | Statistical Analysis | Updated Theory (Appendix A)
📈 Core Price Analysis
Bitcoin Price History and Predictions
Reddit Growth
Coinbase App Ranking
Price Predictions (manual sources)
Bitcoin Price & Network Difficulty
Expo Offset Decay Revisited (Peaks & Future Predictions)
Yearly Bitcoin Lows (Power Law Fit, Interactive)
Bitcoin 10-year Volatility & Log Price
Table of Contents
- 🎯 Bitcoin Retirement Strategy - Make a Profit Long-Term
- Bitcoin Price Modeling and Prediction
- Bitcoin Price Volatility and Risk Analysis
- Investment Strategy Backtesting
- Reddit Community Growth Analysis
- Gold and Bitcoin Comparison
- Data Management and Utilities
- Data Files
- Genesis Day Hypothesis Analysis
- 🔍 Multi-Asset Power Law Scanner (NEW)
- Scale Invariance Research
- 🔬 Bitcoin Power Law Exponent Research (NEW)
- 📊 Rigorous Power Law Testing (Clauset Analysis)
Older files may be outdated.
💰 Bitcoin Retirement Strategy
🎯 Goal: Make a profit long-term in fiat and retire successfully
📚 Comprehensive Retirement Guides
Complete strategy from accumulation → conversion → retirement → legacy planning. Built on 15+ years of Bitcoin power law analysis (R² = 0.96).
📖 Complete Strategy Guide
RETIREMENT_STRATEGY_GUIDE.md (33KB, 30-45 min read)
- Accumulation strategies (DCA, buying dips)
- BTC → Fiat conversion methods
- Tax optimization (international)
- Withdrawal strategies
- 4 real-world scenarios with ROI
⚡ Quick Start Guide
RETIREMENT_QUICK_START.md (15KB, 15 min scan)
- Visual tables & quick reference
- BTC needed by expenses & retirement date
- Current buy/sell zones
- Week-by-week getting started checklist
- Portfolio allocation by age
🗺️ Visual Timeline
RETIREMENT_PATH.md (21KB, 30 min read)
- Year-by-year journey (Age 28→100)
- Portfolio values at each age
- Specific actions at each phase
- Withdrawal strategies by market condition
- Complete tax & ROI summary
🧮 Interactive Retirement Calculator
Calculate how much Bitcoin you need to retire comfortably.
Web-based calculator using power law projections. Input your age, retirement date, and annual expenses to get personalized BTC targets with conservative, trend, and optimistic scenarios.
Calculator Features:
- Power law price projections (R² = 0.96)
- Conservative / Trend / Optimistic scenarios
- Simulates Bitcoin growth during retirement
- Accounts for inflation (7% annual)
- Retirement duration to age 100
- Detailed calculation breakdown
📖 Read Calculator Documentation for usage instructions and examples.
📊 Power Law Price Projections
Based on 15+ years of Bitcoin price data (R² = 0.96):
| Year | Floor Price | Trend Price | Ceiling Price |
|---|---|---|---|
| 2025 | $80,000 | $106,000 | $140,000 |
| 2030 | $237,000 | $315,000 | $418,000 |
| 2035 | $531,000 | $706,000 | $937,000 |
| 2040 | $1.19M | $1.58M | $2.10M |
Volatility Trend: Bitcoin volatility has decreased from ~118% (2020) to ~74% (2025), making it increasingly stable for retirement planning.
💡 Example Retirement Outcomes
Real-world scenarios showing achievable results from modest monthly investments:
Young Professional (Age 28)
- Investment: $500/month × 32 years
- Total: $192,000
- BTC: ~0.5-0.6 BTC
- Retirement Value: $750k-$1.2M
- Annual Income: $85k-$104k
- ROI: 4x-6x
Mid-Career (Age 42)
- Investment: $1,500/month × 18 years
- Total: $324,000
- BTC: ~0.6-0.7 BTC
- Retirement Value: $1.4M-$1.8M
- Annual Income: $105k-$135k
- ROI: 8x-10x
Late Starter (Age 50)
- Investment: $1,200/month × 15 years
- Total: $216,000
- BTC: ~0.5-0.7 BTC
- Retirement Value: $1.5M-$2.5M
- Annual Income: $120k-$170k
- ROI: 6x-10x
See the Complete Strategy Guide for detailed scenarios, tax optimization strategies, and risk management frameworks.
🚀 Quick Start: Your Path to Retirement
- 📖 Read: Quick Start Guide (15 minutes)
- 🧮 Calculate: Use Retirement Calculator to set your target
- 💰 Start DCA: $200-$2,000/month depending on income
- ⏰ Hold: 10+ years minimum (power law requires time)
- 📊 Convert: Gradually 5-10 years before retirement (10-20%/year)
- 💼 Optimize: Tax efficiency varies by jurisdiction - consult local professionals
- 🎯 Diversify: Maintain 10-25% Bitcoin allocation (adjust by age)
⚠️ Important: This is educational information, not financial advice. Tax treatment varies significantly by jurisdiction (USA, Hong Kong, Singapore, UK, etc.). Always consult qualified financial and tax professionals in your country before investing.
Monthly Bitcoin Price Overview
Explore monthly Bitcoin price behavior for every month, with interactive charts and historical data.
View Monthly Price Overview
1. Bitcoin Price Modeling and Prediction
These scripts focus on modeling Bitcoin's price history and making predictions based on different methodologies.
🎯 Interactive Power Law Calculator
Pure JavaScript/HTML Dashboard - No Installation Required
Launch Interactive Power Law Dashboard
Select custom time ranges, adjust analysis windows, calculate power law coefficients (slope, intercept, R²), and predict future prices - all in your browser!
🔮 LPPLS Price Predictions with Confidence Bands
Log-Periodic Power Law Singularity Model - Advanced Price Forecasting
View LPPLS Predictions Visualization
What it does: Uses the LPPLS (Log-Periodic Power Law Singularity) model to generate Bitcoin price predictions with confidence intervals. Unlike simple power law models, LPPLS captures boom-bust cycles and provides error bands.
Key Features:
- 📈 Daily predictions with 68% and 95% confidence bands (±1σ and ±2σ)
- 🎯 Critical time detection - identifies potential market tops/bottoms
- 📊 CSV export with predicted prices and uncertainty bands
- 🔄 Log-periodic oscillations - captures ~4-year Bitcoin cycles
- ⚠️ Uncertainty quantification - know the prediction confidence
Files:
lppls_predictions_with_confidence.py- Run this to generate predictionslppls_daily_predictions.csv- Daily predictions with bandslppls_predictions_with_confidence.png- Visualization
How to use: Run python lppls_predictions_with_confidence.py to generate updated predictions.
The CSV contains columns: predicted_price (central forecast), lower_68/upper_68
(68% confidence range), lower_95/upper_95 (95% confidence range), and percentage deviations.
Example predictions (as of latest run):
2026-01-01: $148,814 (±10.6% at 68% confidence, range: $134k-$165k)
Critical time detected: April 18, 2026 (potential price peak/inflection point)
⚠️ Important: LPPLS predictions include confidence bands showing uncertainty. The model identifies
a "critical time" (tc) where price behavior may change dramatically. Use these as probabilistic forecasts,
not guarantees. The 68% bands mean there's ~68% probability the actual price will fall within that range.
🔴 CRITICAL: Recent analysis shows LPPLS predictions are extremely sensitive to training window size
(100%+ variance). Always test multiple windows and show prediction ranges.
See full sensitivity analysis below ↓
🔴 CRITICAL: LPPLS Window Sensitivity Analysis
⚠️ LPPLS predictions are EXTREMELY sensitive to training window size!
View Full Sensitivity Analysis Visualization
Key Findings from Comprehensive Analysis:
- 🔴 100%+ prediction variance - Predictions for Jan 1, 2026 range from $82,330 to $219,411 (2.66× spread!)
- ⚠️ Window matters hugely - 3-month window: $82K, 3-year window: $219K (same date, same model)
- 📊 Mean prediction: $136,495 ± $44,261 (32% coefficient of variation)
- 📅 Critical time unstable - Varies by 645 days depending on window (Dec 2025 to Sep 2027)
- ❌ 730-day default inadequate - Captures <50% of Bitcoin's 4-year halving cycle
- ⚠️ Longer windows worse - 8+ year windows predict critical times already passed, poor fit
⛔ DO NOT USE SINGLE LPPLS PREDICTIONS FOR INVESTMENT DECISIONS!
✅ RECOMMENDED APPROACH:
• Test multiple windows (1-4 years) and show prediction RANGES
• Use ensemble methods (average across windows)
• Combine with other models (power law, on-chain metrics)
• Focus on bubble detection, not long-term forecasting
❌ AVOID:
• Relying on single-window predictions
• Using LPPLS alone for long-term investment planning
• Treating predictions as deterministic forecasts
📚 Detailed Documentation:
- Full Technical Report - 16-page comprehensive analysis (HTML)
- Executive Summary - Quick reference guide (HTML)
- LPPLS Model Guide - Complete usage documentation (HTML)
- LPPLS Theory & Background - Mathematical foundation (HTML)
- Visualization - Bar chart showing variance across windows
- Raw Results - Machine-readable data (JSON)
lppls_window_sensitivity_analysis.py- Analysis script (run to reproduce)
🔧 Recommended Solution: Ensemble Predictions
To address the sensitivity issue, we now provide ensemble predictions that average across multiple windows:
lppls_ensemble_predictions.py- Run this to generate ensemble forecastslppls_ensemble_predictions.csv- Daily predictions with rangeslppls_ensemble_predictions.png- Visualization with uncertainty bands
How it works: Fits LPPLS models using 5 different windows (1-4 years), then computes ensemble mean, standard deviation, and ranges. Provides realistic uncertainty quantification based on actual model variance.
Example (2026-01-01): $156,161 ± $38,209 (range: $109K-$219K)
Issue #81 Analysis: This comprehensive study tested 9 different time windows (30 days to 15 years) and conclusively demonstrates that LPPLS model predictions are unsuitable for reliable long-term Bitcoin forecasting without significant modifications. The model is better suited for real-time bubble detection during active market runs.
📖 Complete LPPLS Documentation Library
All reports now available in HTML format for easy reading:
🔴 Window Sensitivity Report
16-page technical analysis of LPPLS model sensitivity to training window size.
Read Full Report →💡 Tip: Start with the Executive Summary for a quick overview, then dive into the Full Technical Report for detailed analysis. The Model Guide provides practical usage instructions.
✨ Power Law + Log-Periodic Oscillation Model
The cyclical model achieving R² > 0.9 used by Giovanni Santostasi, Harold Burger, @quantadelic, etc.
Model Formula:
What it captures:
- 📈 Power law trend: Long-term exponential growth (β*log(t) component)
- 🔄 4-year cycles: Boom-bust cycles from halving events (cosine oscillation)
- ✅ Excellent fit: R² = 0.89-0.95 depending on cycle period assumption
- 🎯 Best unconstrained fit: R² = 0.947 (finds ~20-year super-cycle)
- 📊 4-year halving model: R² = 0.916 (captures halving-driven cycles)
Key Results:
Tested 6 parameter variations from 3-year to 5-year cycles:
- 4-year cycle (halving): R² = 0.916, ~1.9 oscillations in 14.8 years of data
- 4.5-year cycle: R² = 0.917 (best constrained fit)
- 5-year cycle: R² = 0.918
- Unconstrained: R² = 0.947 (best overall, finds longer super-cycle)
Files:
powerlaw_cyclical_model.py- Run this to reproduce analysispowerlaw_cyclical_analysis.png- 6-panel visualization (log-linear, log-log, residuals, isolated cycles, R² comparison, cycle period comparison)powerlaw_cyclical_results.json- Detailed parameters for all variations
✅ This is the model referenced in the comment: "The actually good models that clearly outperform the naïve power-law regression are extensions that add the obvious 4-year cyclical component... Formula roughly: log(price) = A + β log(t) + C cos(ω log(t) + φ)"
- btc_price_graph.py: This script is the core of the price analysis. It calculates and plots
Bitcoin's price history, trend line, floor price, and ceiling price based on Giovanni Santostasi's Power Law
concept. It generates both an interactive HTML chart (
btc_price_graph.html) and static PNG images (btc_price_graph-history_plot.png
, btc_price_graph_linear_linear.png
, btc_price_graph_log_linear.png
, btc_price_graph_log_log.png
)
showing different scale combinations. It also updates the (btcpricehistory.csv) file with the latest price data from Binance and saves the power law coefficients inpl_coefficients.json. - Bitcoin Monthly Price Behavior Overview: A portal to monthly Bitcoin price behavior charts for each month.
btc_price_monthly_overview.htmlprovides links and previews for all months, e.g.btc_price_monthly_01.html(January),btc_price_monthly_02.html(February), etc.
- btc_price_graph.html: An interactive HTML chart generated by
btc_price_graph.py, allowing for dynamic exploration of the Bitcoin price history and trend lines.
- btc_price_graph-history_plot.png: A static PNG image generated by
btc_price_graph.pyshowing the historical Bitcoin price, trend line, floor, and ceiling prices on a log-log scale.
- btc_price_graph_linear_linear.png: A static PNG image generated by
btc_price_graph.pyshowing the Bitcoin price history on a linear-linear scale.
- btc_price_graph_log_linear.png: A static PNG image generated by
btc_price_graph.pyshowing the Bitcoin price history on a log-linear scale.
- btc_price_graph_log_log.png: A static PNG image generated by
btc_price_graph.pyshowing the Bitcoin price history on a log-log scale.
- btc_price_interactive_pl.py: Creates a Dash web application (
btc_price_interactive_pl.html, andbtc_price_interactive_pl.png
) that allows users to
interactively explore Bitcoin's price using a power law model. Users can adjust the analysis time window and
select a date for price prediction.- Outputs: An interactive flask app,
btc_price_interactive_pl.html, andbtc_price_interactive_pl.png
- Outputs: An interactive flask app,
- btc_price_interactive_pl.html/png: The interactive Dash app and a static PNG image of the
interactive plot generated by
btc_price_interactive_pl.py. - btc_price_graph-alternative.py: Provides an alternative implementation for calculating and
plotting the Bitcoin price trend using the RANSAC algorithm for floor and ceiling prices. Generates
btc_price_graph-history_plot-alternative.png
.
- btc_price_graph-history_plot-alternative.png: Static PNG image of Bitcoin price history and
trend lines generated by
btc_price_graph-alternative.py
- btc_price_graph-png-only.py: Generates a static PNG image similar to
btc_price_graph.pybut without the interactive components or data updating. Producesbtc_price_graph-png-only-history_plot.png
.
- btc_price_graph-png-only-history_plot.png: The static PNG image created by
btc_price_graph-png-only.py.
- btc_power_law.py: Uses the coefficients saved by
btc_price_graph.pyinpl_coefficients.jsonto calculate trend, floor, and ceiling prices for any given date.- Outputs: A series of test case prices with trend, floor and ceiling prices.
- btc_price_pl_compare_periods.py: Evaluates the power law model's accuracy over different
historical time periods by comparing predictions to the full price history. Generates an interactive heatmap
(
btc_price_pl_compare_periods.html) and a static PNG (btc_price_pl_compare_periods-r_squared_heatmap.png).- Outputs:
btc_price_pl_compare_periods.htmlandbtc_price_pl_compare_periods-r_squared_heatmap.png.
- Outputs:
- btc_price_pl_compare_periods.html/png: The interactive heatmap and corresponding PNG
created by
btc_price_pl_compare_periods.py. - btc_price_predictions_graph.py: Graphs price predictions from an Excel file with error
bars. Generates
btc_price_predictions.htmlandbtc_price_predictions.png
using data from cleaned_btc_price_predictions.csv.- Outputs:
btc_price_predictions.htmlandbtc_price_predictions.png
.
- Outputs:
- btc_price_predictions_interactive.py: This script downloads a live Excel file from
OneDrive, cleans it and produces an interactive graph of the predictions using Plotly. Generates
btc_price_predictions_interactive.htmlandbtc_price_predictions_interactive.png.- Outputs: An interactive flask app,
btc_price_predictions_interactive.htmlandbtc_price_predictions_interactive.png.
- Outputs: An interactive flask app,
- btc_price_predictions_interactive.html/png: The interactive HTML chart and a static PNG
from
btc_price_predictions_interactive.py. - btc_peak_price_prediction.py: Identifies and analyzes Bitcoin price peaks and compares them
to a power law prediction. Generates
bitcoin_peaks.html.- Outputs:
bitcoin_peaks.html.
- Outputs:
- bitcoin_peaks.html: The interactive plot produced by
btc_peak_price_prediction.py. - btc_pl_4yma_interactive.html: Interactive HTML file generated by
btc_pl_4yma.py.
- btc_peak_analysis.py: Analyzes Bitcoin price peaks and trends, generating an interactive HTML report and a static PNG image. Outputs:
btc_peak_analysis.htmlandbtc_peak_analysis.png.- Outputs:
btc_peak_analysis.html,btc_peak_analysis.png.
- Outputs:
- expo_offset_decay_revisited.py: Revisits the exponential offset decay method for predicting Bitcoin price peaks. Generates an updated interactive HTML report and PNG image. Outputs:
expo_offset_decay_revisited.htmlandexpo_offset_decay_revisited.png. - btc_price_graph_with-365-dSMA.html: Interactive Bitcoin price chart with 365-day Simple Moving Average overlay for trend analysis.

- btc_interactive_dashboard_js_full.html: Interactive JavaScript dashboard providing comprehensive power law evidence analysis with multiple visualization panels.

- btc_yearly_lows_bar_chart.html: Interactive chart analyzing yearly Bitcoin lows with power law fitting for historical trend analysis.

How Are Power Law Peak Predictions Calculated?
The predicted future Bitcoin price peaks ("decaying exponential ratio to power law floor") are calculated as follows:
Historical cycle peaks are identified and their ratio to the power law floor price at the same date is computed. These ratios are then fit to an exponential decay function using the script expo_offset_decay.py. The fitted function is used to predict the offset ratio for future peaks, which is multiplied by the power law floor price to estimate the next peak. This method is based on the observation that the ratio of peak price to power law floor has historically decayed in an exponential fashion.
The actual calculation and fitting is performed by expo_offset_decay.py (using btc_power_law.py for floor price calculation), and the resulting predicted peak values are hardcoded in btc_price_graph.py for use in visualizations.
2. Bitcoin Price Volatility and Risk Analysis
These scripts analyze Bitcoin's price volatility and assess potential risks.
- btc-volatility-graph.py: Calculates and visualizes Bitcoin's 10-year annualized volatility using rolling daily log returns alongside the natural log of price. Generates both an interactive HTML chart (
btc_volatility_graph.html) and a high-resolution static PNG image (btc_volatility_graph.png
) showing dual-axis plots. The graph demonstrates how Bitcoin's volatility has declined from ~118% in 2020 to ~74% currently while price has increased.
- btc_volatility_graph.html/png: Interactive and static visualizations showing Bitcoin's 10-year rolling annualized volatility and log price over time, generated by
btc-volatility-graph.py. - btc_price_normal_drop.py: Analyzes and visualizes the distribution of daily price drops
during boom periods, generating a histogram (
drops_histogram.png
) and a kernel density estimation
plot (drops_kde.png
). It also generates a chart (outcome_of_target_drops.png
)
showing the probability of price movement up or down after a drop of a given %. Uses boom periods from bitcoin_price_with_boom_periods.png
.
- drops_histogram.png/drops_kde.png/outcome_of_target_drops.png: Static PNG images generated
by
btc_price_normal_drop.py. Alsobitcoin_price_with_boom_periods.png
. - btc_price_delta.py: Analyzes and visualizes the percentage change in Bitcoin's closing price against days since the last halving, generates a single plot showing price delta percentage and rolling standard deviation. Uses the concept of halving cycles.
- btc_time_price_ratio_analysis.py: Analyzes the relationship between price and time ratios,
generating a scatter plot with a power law fit line and confidence intervals (
btc_time_price_ratio_analysis.png
). Uses the concept of a power law
relationship.- Outputs:
btc_time_price_ratio_analysis.png
.
- Outputs:
- btc_time_price_ratio_analysis.png: The generated PNG image from
btc_time_price_ratio_analysis.py.
- scale_ratio.py: A generalized version of time/price ratio analysis. It takes command-line
arguments for data file, date column, price column, graph title, and start date to perform a power-law scale
ratio analysis. It outputs a PNG graph (
scale_ratio_analysis_TITLE.png).- Outputs:
scale_ratio_analysis_TITLE.png.
- Outputs:
- scale_ratio_analysis_TITLE.png: PNG output from running
scale_ratio.py. - estimate_day_one.py: Estimates the hypothetical "day one" price of Bitcoin based on
historical data and a power law model. Takes command-line arguments for data source and column names and
generates a histogram of day one estimates (
day_one_estimates.png). Uses the concept of a power law and extrapolation.- Outputs:
day_one_estimates.png.
- Outputs:
- day_one_estimates.png: The histogram of estimated "day one" dates generated by
estimate_day_one.py. - btc_price_growth_from_previous_ath.py: Analyzes Bitcoin price growth relative to the previous cycle's all-time high (ATH), generating an interactive Plotly chart. Uses the concept of market cycles and relative price growth.
- btc_peak_ratios.py: Calculates and prints a table showing various ratios for each Bitcoin
peak, including peak to peak ratio, peak to low ratio, peak to trend ratio, and peak to ceiling ratio,
defined in
btc_constants.py.- Outputs: Outputs a table of ratios to the console.
- btc_daily_movement_histogram.py: Generates and saves interactive histogram charts and PNG
images (
btc_daily_movements_all.html,btc_daily_movements_all.png
,
btc_daily_movements_YYYY.htmlandbtc_daily_movements_YYYY.png).- Outputs:
btc_daily_movements_all.html,btc_daily_movements_all.png
,
btc_daily_movements_YYYY.htmlandbtc_daily_movements_YYYY.png.
- Outputs:
- btc_daily_movements_YYYY.html/png: Interactive HTML and PNG images for each year, generated by
btc_daily_movement_histogram.py. For example:btc_daily_movements_2010.html
, btc_daily_movements_2011.html
, ... - dip_analyzer.py: Identifies and visualizes Bitcoin price dips. It detects local peaks and
troughs to find significant price drops and plots them on an interactive HTML graph (
dip_analysis_plot.html) and saves a static PNG (dip_analysis_plot.png
). Dip statistics are also saved to
(dips.csv).- Outputs:
dip_analysis_plot.html,dip_analysis_plot.png
, dips.csv.
- Outputs:
- dip_analysis_plot.html: Interactive HTML chart generated by
dip_analyzer.py, highlighting identified Bitcoin price dips and allowing users to pan and zoom for detailed analysis. - dip_analysis_plot.png: Static PNG image of the dip analysis chart from
dip_analyzer.py. - dips.csv: CSV file containing detailed statistics for each identified Bitcoin price dip, including peak and trough dates, prices, drop percentage, and recovery time.
- btc_difficulty_price_graph.py: Plots both Bitcoin price and network difficulty on the same
chart, using data from
btcpricehistory.csvanddifficultychartdata.csv. Produces an interactive HTML chart (btc_difficulty_price_graph.html) and a static PNG (btc_difficulty_price_graph.png) to visualize how price and mining difficulty have evolved together over time.
3. Investment Strategy Backtesting
These scripts simulate different investment strategies.
- btc-_sell-2024-10-10.py: Backtests a fixed percentage selling strategy. Output includes
individual run CSVs (
strategy_results_PERIOD_THRESHOLD.csv), a heatmap (btc_analysis_heatmap_fixed_percentage_strategy.png
) and an Excel pivot table (btc_analysis_pivot_table_fixed_percentage_strategy.xlsx).- Outputs: Individual strategy runs as CSVs (
strategy_results_PERIOD_THRESHOLD.csv), a heatmap (btc_analysis_heatmap_fixed_percentage_strategy.png
) and an Excel pivot table
(btc_analysis_pivot_table_fixed_percentage_strategy.xlsx).
- Outputs: Individual strategy runs as CSVs (
- btc_analysis_heatmap_fixed_percentage_strategy.png/btc_analysis_pivot_table_fixed_percentage_strategy.xlsx:
Output from
btc-_sell-2024-10-10.py.
- strategy_scoring_fixed_percentage.py: Contains the core logic for the fixed percentage
selling strategy used in
btc-_sell-2024-10-10.py. It can be run standalone to test the strategy with specific parameters. Outputs strategy results and score. - btc-_sell-2024-10-03.py: Backtests a reducing trailing stop-loss strategy and generates a
heatmap (
btc_analysis_heatmap_reducing_08_pct_dampen_sell_001.png
) and an Excel file (btc_analysis_pivot_table_reducing_08_pct_dampen_sell_001.xlsx) of results.- Outputs: a heatmap (
btc_analysis_heatmap_reducing_08_pct_dampen_sell_001.png
) and an Excel file (btc_analysis_pivot_table_reducing_08_pct_dampen_sell_001.xlsx) of results.
- Outputs: a heatmap (
- btc_analysis_heatmap_reducing_08_pct_dampen_sell_001.png/btc_analysis_pivot_table_reducing_08_pct_dampen_sell_001.xlsx:
Output from
btc-_sell-2024-10-03.py.
- strategy_scoring_reducing_trailing_stop_lost_pct.py: Implements a reducing trailing
stop-loss strategy, where the stop loss is based on a previous ath. Used by
btc-_sell-2024-10-03.py. It calclates a score and generates plotly graphs of price, money and btc balance, but the graphs aren't saved to file. - strategy_scoring_trailing_stop_lost_pct.py: Contains the logic for a trailing stop-loss
strategy, calculating a score and generating HTML charts, although these are not currently saved to file.
Used by
btc-_sell-2024-10-03.py. - simulation.py: provides a generic framework for simulating trading strategies. Includes a
lump sum and a trend line following strategy. The function
test_strategy_periodscould be used to test any of the strategies on yearly periods.- Outputs: Example Lump Sum Strategy Performance and Trend Line Strategy Performance.
4. Reddit Community Growth Analysis
These scripts analyze the growth of the r/Bitcoin subreddit and its relationship with Bitcoin's price.
- reddit-growth.py: Analyzes the growth of the r/Bitcoin subreddit and its correlation with Bitcoin's price, generating charts and statistics to understand the relationship between social media activity and market trends.
- reddit-growth-of-readers.html: Interactive HTML report on Reddit community growth and its
correlation with Bitcoin price, generated by
reddit-growth.py.
- reddit-growth-of-readers.png: Static PNG image of Reddit community growth analysis.
- reddit-pricegrowth_vs_subgrowth_scatter.html: Interactive scatter plot of daily Bitcoin price growth vs. daily Reddit subscriber growth, with R² value in the title. Generated by
reddit-growth.py.
- reddit-relchange_price_vs_subs_scatter.html: Interactive scatter plot of relative change since start (price vs. subscribers), with R² value in the title. Generated by
reddit-growth.py.
- reddit-price_vs_logmembership_scatter.html: Interactive scatter plot of Reddit log(Membership) vs. Bitcoin Price, with R² ≈ 0.94 (the best fit). Generated by
reddit-growth.py.
- scale_ratio_logmembership_vs_price.png: Scale invariance test for log(Reddit membership) vs. price. Scatter plot of random log(membership) ratios vs. price ratios, with power law fit and R² value (≈ 0.93).
- reddit3.py: Explores different statistical models (linear, LOWESS, polynomial, lagged) to analyze the relationship between subreddit subscribers and Bitcoin price. Generates a static plot.
- Outputs: a plot of the various regressions.
- reddit4.py: Performs Granger causality tests to determine if Bitcoin price predicts subreddit growth or vice versa.
- reddit_graph.py: Downloads and visualizes Bitcoin subreddit membership growth against the Bitcoin price using an interactive Plotly chart and downloads an Excel file (
membership_data.xlsx).- Outputs: an interactive flask app and a downloaded
membership_data.xlsxfile.
- Outputs: an interactive flask app and a downloaded
- reddit_price_vs_subscribers_fit.html: Interactive HTML chart showing the relationship between Bitcoin price and Reddit subscribers, fitted with a power law regression.
- Outputs:
reddit_price_vs_subscribers_fit.html.
- Outputs:
- reddit_price_vs_subscribers_fit.png: Static PNG image of the price vs subscribers fit chart.
- Outputs:
reddit_price_vs_subscribers_fit.png.
- Outputs:
5. Gold and Bitcoin Comparison
These scripts compare the historical price trends of Gold and Bitcoin, analyzing their correlation and divergence.
- gold_btc_comparison.py: Compares the historical price trends of Gold and Bitcoin, analyzing their correlation and divergence. Generates charts and statistics to understand the relationship between these two assets.
- gold_btc_correlation.html: Interactive HTML report on the correlation between Gold and
Bitcoin prices, generated by
gold_btc_comparison.py. - gold_btc_correlation.png: Static PNG image of Gold and Bitcoin correlation analysis.
6. Data Management and Utilities
Scripts for managing data downloads, uploads, and utility functions.
- btc_utils.py: Utility functions for Bitcoin data analysis, used across various scripts for common operations.
7. Data Files
Details and links to the data files used in the btcgraphs project.
- btcpricehistory.csv: Comprehensive Bitcoin price history used across multiple scripts for analysis and modeling. Contains daily price data, calculated trend lines, and power law coefficients.
- difficultychartdata.csv: Contains historical data on Bitcoin mining difficulty, used for analyzing the relationship between Bitcoin price and mining difficulty.
- cleaned_btc_price_predictions.csv: Cleaned and processed Bitcoin price predictions from Giovanni Santostasi's model, used for comparison and analysis of predictive performance.
- coinbase_ranking.csv: Data file containing Coinbase app ranking information, used for app ranking analysis and visualizations.
- btc_intermediate_values.csv: CSV file containing key model attributes, coefficients, historical and predicted peaks, and predicted winter lows. Generated automatically by
btc_price_graph.py. Download/view CSV.
8. Genesis Day Hypothesis Analysis
Comprehensive validation of the January 3, 2009 starting date for Bitcoin power law modeling
This analysis addresses the fundamental question of whether January 3, 2009 (Bitcoin's Genesis Block date) is the optimal starting point for Bitcoin power law modeling, or if alternative dates provide better model fits.
🎯 Key Findings
The Genesis Day Hypothesis is VALIDATED: January 3, 2009 is empirically near-optimal for Bitcoin power law modeling:
- Genesis Date R²: 0.9599 (96th percentile of all tested dates)
- Optimal Date: June 15, 2009 with R² = 0.9609
- Improvement: Only 0.0009 (0.09%) - practically insignificant
- Conclusion: Giovanni Santostasi's choice is both theoretically sound and empirically justified
📊 Comprehensive Analysis
Systematically tested 147 different starting dates from 2009-2014:
- R² Range: 0.6494 to 0.9609 (significant sensitivity to start date)
- Early 2009 Robustness: All dates January-June 2009 produce R² > 0.96
- Performance Degradation: Later start dates show dramatic quality decline
🏆 Bitcoin vs Traditional Assets
Bitcoin's power law behavior is exceptional compared to other assets:
- Bitcoin (Genesis): R² = 0.9599 ⭐
- Apple (best period): R² = 0.8194
- Tesla (IPO+): R² = 0.7109
- Gold ETF: R² = 0.7654
- S&P 500: R² = 0.7730
Analysis Tools and Files
- genesis_date_sensitivity_analysis.py: Comprehensive analysis framework (21,000+ lines) that tests power law model fit quality across 147 different starting dates from 2009-2014. Generates interactive visualizations and statistical summaries validating the Genesis date choice.
- multi_asset_power_law_analysis.py: Multi-asset comparison framework (11,000+ lines) that tests power law behavior across traditional assets (Apple, Tesla, Gold, S&P 500) to benchmark Bitcoin's exceptional power law properties.
- Outputs: Cross-asset comparison charts and statistical summaries
- multi_asset_power_law_dashboard.html: Interactive dashboard for multi-asset power law analysis, allowing comparison of Bitcoin's power law behavior against traditional assets (Apple, Tesla, Gold, S&P 500) with real-time parameter adjustments.

- genesis_date_sensitivity_analysis.html: Interactive 4-panel dashboard (4.7MB) showing R² vs start date analysis, performance distributions, and detailed sensitivity analysis with Genesis vs optimal date annotations.
- genesis_date_comparison.html: Side-by-side interactive comparison (5.4MB) of Genesis date model vs optimal date model, showing actual vs predicted price overlays and demonstrating minimal practical difference.
📊 Key Visualizations and Charts
- genesis_date_sensitivity_analysis.png: Static chart showing Bitcoin power law R² values vs starting dates, with Genesis date highlighted as near-optimal (96th percentile performance). Demonstrates empirical validation of the Genesis day choice.
- bitcoin_vs_other_assets_comparison.png: Comprehensive comparison chart showing Bitcoin's exceptional R² = 0.9599 vs traditional assets (Apple: 0.8596, Tesla: 0.7545, Gold: 0.7654, S&P 500: 0.7698). Validates Bitcoin's unique power law behavior.
- genesis_analysis_data_sources.png: Complete methodology and data source documentation chart explaining Bitcoin data (btcpricehistory.csv) and traditional asset data (Yahoo Finance), with statistical validation steps and quality assurance measures.
- genesis_date_analysis_interactive_dashboard.html: 4-panel interactive dashboard (4.7MB) with R² sensitivity analysis, distribution plots, multi-asset comparison, and summary statistics table. Provides comprehensive view of all analysis results.
- genesis_day_hypothesis_visualizations_summary.md: Complete documentation of all visualizations, data sources, methodology transparency, and statistical validation. Addresses legitimacy of data sources and reproducibility of results.
Documentation Files
- genesis_day_hypothesis_analysis.md: Complete analysis report (11,700 words) containing executive summary, literature review, methodology, statistical analysis, discussion, and recommendations. Comprehensive documentation of the entire research project.
- analysis_summary.md: Executive summary and key findings from the Genesis Day analysis, including project completion summary, new tools created, scientific contributions, and recommendations for future work.
- bibliography.md: Academic literature review (22 sources) covering network theory foundations, power law research, and critical analysis references supporting the theoretical framework.
- genesis_date_analysis_summary.json: Machine-readable results file containing statistical summaries, key findings, and structured data from the complete analysis.
🔬 Scientific Contributions
- First systematic validation of the Genesis day choice in Bitcoin power law modeling
- Reproducible methodology for cryptocurrency power law analysis
- Cross-asset comparison framework establishing Bitcoin's exceptional behavior
- Literature synthesis integrating network theory and empirical validation
💡 Usage and Recommendations
Usage:
# Run complete Genesis date sensitivity analysis
python genesis_date_sensitivity_analysis.py
# Compare Bitcoin with traditional assets
python multi_asset_power_law_analysis.py
# View interactive results
open genesis_date_sensitivity_analysis.html
open genesis_date_comparison.html
Recommendations:
- Continue using Genesis date for Bitcoin power law modeling - empirically validated
- Apply methodology to other cryptocurrencies using their respective genesis dates
- Use sensitivity analysis as standard practice in power law modeling
- Consider network birth dates for assets with network effects
This analysis provides definitive empirical support for the Genesis day hypothesis while establishing new tools and methodologies for rigorous cryptocurrency power law analysis.
9. Multi-Asset Power Law Scanner
Production-grade tool for systematically testing 1000+ assets for power law behavior
The Multi-Asset Power Law Scanner provides automated analysis of power law trends across diverse asset classes (stocks, ETFs, cryptocurrencies, commodities, indices) to identify which assets exhibit Bitcoin-like power law behavior.
🎯 Key Features
- Dual Analysis: Full dataset from optimized genesis date + recent regime from inflection point
- Genesis Optimization: Automatic R² maximization to find optimal starting date for each asset
- Inflection Detection: Statistical change point detection to identify regime shifts
- Investment Focus: Combines R² (fit quality) with exponent (growth rate) for investment decisions
- Multi-Source Data: yfinance (primary) with Kraken API fallback for cryptocurrencies
- Resumable Execution: JSON state management allows pausing and resuming long scans
- Automated Visualization: Generates 6 types of charts automatically after each run
📊 Latest Scan Results - Cumulative Database
Cumulative Analysis Summary
This section shows results from the cumulative database of all scanned assets across multiple runs. The scanner has analyzed 1,985+ assets across 50+ market categories, building a comprehensive power law analysis database.
🏆 Best Power Law Fits Found:
- CPN.BK (Thailand): R²=0.9423, Exponent=1.72 — Champion
- RMV.L (UK): R²=0.9391, Exponent=0.85
- ULTA (US): R²=0.9383, Exponent=0.99
Top Investment Candidates (R²≥0.80, Exponent≥1.5):
- HD (Home Depot): R²=0.8601, Exponent=2.18, Score=1.88 — Excellent
- AMGN (Amgen): R²=0.9071, Exponent=2.05, Score=1.86 — Excellent
- DHR (Danaher): R²=0.8273, Exponent=2.24, Score=1.85 — Excellent
- UNH (UnitedHealth): R²=0.8709, Exponent=2.05, Score=1.79 — Excellent
- WMT (Walmart): R²=0.9187, Exponent=1.93, Score=1.77 — Excellent
Database Statistics:
- Total Assets: 1,985+ across 52 market categories
- Excellent fits (R²≥0.90): 46 assets (2.3%)
- Investment grade (R²≥0.80, Exp≥1.5): 545+ assets
- Best emerging market: Indian NSE (avg R²=0.800)
Note: To see the full latest statistics, view latest_quick_stats.txt
💎 Investment Opportunities Table
Interactive Investment Opportunities
View a comprehensive, sortable, and filterable table of all "green zone" investment opportunities (R²≥0.80, Exponent≥1.5).
✨ Features:
- Sortable: Click any column header to sort
- Searchable: Filter assets by name, category, or exchange
- Responsive: Works on desktop, tablet, and mobile
- Direct Links: Click any asset name to view on Yahoo Finance
- Export: Download results as CSV or print
📊 View Investment Opportunities Table →
Quick Stats:
- 62 green zone assets from 1,985 analyzed
- Top score: 2.524 (FMG.AX - Australia)
- Average R²: 0.860 | Average Exponent: 1.77
- Markets: USA, India, Australia, Turkey, Thailand, China, and more
📈 Latest Visualizations
Click on images to view full resolution, or use the interactive versions for detailed exploration.
Top 20 Assets by R²
Color-coded ranking: red (>0.95), orange (>0.90), gold (>0.80), showing best power law fits.
Investment Quality Map
R² vs Exponent scatter plot with volatility. Green zone = High fit + Strong growth. Larger dots = smoother growth.
📊 Interactive Version (Hover for details)
🔧 Tools and Scripts
- multi_asset_powerlaw_scanner.py: Main scanner (26KB) with dual analysis, genesis optimization, inflection detection, and comprehensive CSV output (23 columns per asset).
- run_scanner.sh: Shell script for automated execution with dependency checking, error handling, and auto-visualization generation.
- visualize_scanner_results.py: Visualization tool that generates 6 types of charts (PNG + interactive HTML) from CSV results.
- powerlaw_genesis.py: Genesis optimization and inflection detection module using ruptures library for change point detection.
- test_multi_asset_powerlaw_scanner.py: Test suite (11 tests) validating scanner accuracy, state management, and CSV format.
📄 Documentation
- MULTI_ASSET_SCANNER_README.md: Technical documentation (12KB) with configuration reference, API details, and performance benchmarks.
- SCANNER_QUICKSTART.md: Step-by-step Ubuntu setup guide, usage examples, troubleshooting, and workflows.
- Latest Quick Stats: Real-time statistics from most recent scan including R² distribution, investment candidates, and category analysis.
💡 Usage
# Test mode (10 assets, ~45 seconds)
chmod +x run_scanner.sh
./run_scanner.sh
# View results
cat output/visualizations/latest_quick_stats.txt
firefox output/visualizations/r2_vs_exponent_investment_interactive.html
# Resume interrupted scan
./run_scanner.sh --resume
# Custom configuration
./run_scanner.sh --config myconfig.json
🎯 Key Findings
- Bitcoin's Uniqueness: Zero tested assets achieve Bitcoin-tier R² (>0.95), confirming exceptional power law behavior
- Exponent Matters: 30% of assets have low growth (Exponent<1.0) despite sometimes good R² - not investment-worthy
- Investment Sweet Spot: Only 20% of assets qualify as excellent investments (R²≥0.80, Exp≥1.5)
- Category Insights: Crypto shows highest R² variance, Tech shows consistent moderate fits, Commodities show low exponents
🚀 Interactive Results
- R² Distribution (Interactive)
- Top Assets (Interactive)
- Investment Quality Map (Interactive)
- Category Comparison (Interactive)
Note on Data: Test mode uses yfinance which provides limited Bitcoin history (2014+). For production analysis with full Bitcoin data from 2010, the tool would need enhancement to use local btcpricehistory.csv or other comprehensive sources.
10. Scale Invariance Research
Comprehensive investigation of Bitcoin's scale invariance property and comparison with other assets
This research addresses a fundamental question: Is Bitcoin's scale invariance property unique, or could other assets show similar behavior with different "genesis dates"?
🎯 Key Findings (Updated with PR #53 - Consolidated Analysis)
⭐ BREAKTHROUGH: Network Infrastructure Shows BETTER Scale Invariance Than Bitcoin!
- Internet Users R²: 0.9788 (20 data points, World Bank) - BEST EVER MEASURED!
- Broadband Subscriptions R²: 0.9599 (20 data points, World Bank) - Exceptional!
- McDonald's Restaurants R²: 0.9293 (130 data points, SEC EDGAR) - Validates franchise model
- Bitcoin R²: 0.9054 (5,562 data points) - Still excellent
Validation: This confirms the hypothesis about infection patterns in clustered networks - exactly what we were looking for! Network infrastructure grows via clustered expansion (city-to-city, household-to-household) just like Bitcoin.
Analysis Improvements (Threshold Lowered 30 → 20 Points):
- 16 assets analyzed (was 11 with 30-point threshold)
- 5 new assets added: Internet Users, Broadband, Electricity Access, DTP3/Measles Immunization
- All data from live sources: Yahoo Finance, SEC EDGAR, World Bank API, WHO API
- Mobile-friendly reports: Embedded scatter plots, comprehensive analysis
📊 What is Scale Invariance?
Scale invariance means that when you randomly pick two dates (t₁, t₂) and calculate:
- Time Ratio: t₂/t₁ (how much time passed)
- Price Ratio: P₂/P₁ (how much price changed)
These ratios follow a near-perfect power law: Price_Ratio = A × Time_Ratio^B
In log-log space, this creates a straight line. High R² values indicate strong scale invariance.
🏆 Current Analysis Results (16 Assets with 20-Point Threshold)
Consolidated analysis from scale_invariance_complete_system.py with live data downloads:
| Rank | Asset | Category | R² | Exponent | Points |
|---|---|---|---|---|---|
| 1 | ⭐ Internet Users | Technology | 0.9788 | 2.38 | 20 |
| 2 | ⭐ Broadband Subscriptions | Technology | 0.9599 | 2.03 | 20 |
| 3 | ⭐ McDonald's Restaurants | Business | 0.9293 | 1.09 | 130 |
| 4 | ⭐ Electricity Access | Infrastructure | 0.9165 | 1.05 | 26 |
| 5 | ⭐ Bitcoin | Financial | 0.9054 | 5.73 | 5,562 |
| 6 | Mobile Subscriptions | Technology | 0.7777 | 2.18 | 36 |
| 7 | Global Population | Demographics | 0.7160 | 0.23 | 65 |
| 8 | Microsoft | Financial | 0.6931 | 1.57 | 9,991 |
| 9-16 | Others | Various | < 0.70 | Various | -- |
Key Insight: Network infrastructure (Internet, Broadband) shows BETTER scale invariance than Bitcoin! This validates the hypothesis about infection patterns in clustered networks.
📊 Previous Genesis Date Hypothesis Research
Historical note: Earlier research tested financial assets with multiple genesis dates. Results archived in old reports. Current consolidated system provides more comprehensive cross-domain analysis with live data.
| Asset (Historical) | R² (Old Genesis Study) | |||
|---|---|---|---|---|
| Bitcoin (genesis-optimized) | 0.9624 | |||
| Microsoft | 0.8516 | |||
| S&P 500 | 0.8247 | |||
| Apple | 0.6179 | 1993-01-08 | 1.92 | -34.45 pp |
Key Insight: Even when we optimize start dates for each asset, Bitcoin's scale invariance remains unmatched. The 11+ percentage point gap to the next-best asset is statistically highly significant.
📈 Visualizations (Current Consolidated Report)
Comparison Chart
- scale_invariance_consolidated_comparison.png: Comprehensive bar chart comparing R² values across all 16 analyzed assets.
Individual Asset Scatter Plots (Top 8)
Each scatter plot shows 4 panels: (1) Time ratio vs value ratio with power law fit, (2) Random date pair sampling pattern, (3) Value pair sampling distribution, (4) Residuals from power law fit.
- scatter_internet_users.png: ⭐ Internet Users (R² = 0.9788) - BEST!
- scatter_broadband_subscriptions.png: ⭐ Broadband Subscriptions (R² = 0.9599)
- scatter_mcdonald_s_restaurants.png: ⭐ McDonald's Restaurants (R² = 0.9293)
- scatter_electricity_access.png: ⭐ Electricity Access (R² = 0.9165)
- scatter_bitcoin.png: ⭐ Bitcoin (R² = 0.9054)
- scatter_mobile_subscriptions.png: Mobile Subscriptions (R² = 0.7777)
- scatter_global_population.png: Global Population (R² = 0.7160)
- scatter_microsoft.png: Microsoft (R² = 0.6931)
- scale_invariance_scatter_s&p_500.png: S&P 500 index analysis (R² = 0.8247)
- scale_invariance_scatter_ethereum.png: Ethereum cryptocurrency analysis (R² = 0.6778)
- scale_invariance_scatter_google.png: Google stock analysis (R² = 0.7762)
📄 Research Documentation
📘 Consolidated Report (CURRENT - PR #53)
⭐ CURRENT: End-to-End Analysis with Live Data
- scale_invariance_consolidated_report.html:
Complete consolidated report with LIVE data downloads from Yahoo Finance, SEC EDGAR, World Bank API, WHO API.
Total coverage: 16 assets analyzed (8 financial + 8 phenomena with ≥20 data points)
Features: Mobile-friendly, embedded scatter plots, comprehensive data sourcing, 20-point minimum threshold
Key Finding: Internet Users R²=0.9788 BEATS Bitcoin - validates network infection hypothesis!
- scale_invariance_consolidated_report.md:
Markdown source with embedded images. Auto-generated by
scale_invariance_complete_system.py.
Analysis System
- scale_invariance_complete_system.py:
⭐ Complete end-to-end analysis system that downloads live data, analyzes scale invariance, generates scatter plots, and produces mobile-friendly reports.
- Data sources: Yahoo Finance, SEC EDGAR, World Bank API, WHO API, FHWA
- Outputs: 16 scatter plots, comparison chart, HTML/MD reports
- To regenerate: Run
python3 scale_invariance_complete_system.py
- SCALE_INVARIANCE_SYSTEM_SPEC.md: Technical specification (16KB) with system architecture, data sources, methodology
- DATA_SOURCES.md: Comprehensive API documentation (8.7KB) with 20+ authoritative sources
- download_world_bank_data.py: Standalone World Bank API downloader
- download_who_data.py: Standalone WHO Global Health Observatory downloader
🧮 Network Effects and Scale Invariance
Updated Understanding (with PR #53 consolidated data):
- Internet Infrastructure is BEST: Internet Users (R²=0.9788) and Broadband (R²=0.9599) show BETTER scale invariance than Bitcoin (R²=0.9054). This validates the infection-in-clustered-networks hypothesis!
- Network Effect Validation: Infrastructure grows via clustered expansion - city-to-city, household-to-household - exactly the pattern we hypothesized for Bitcoin and McDonald's.
- Bitcoin's Unique Exponent: Bitcoin's power law exponent 5.73 is still 2-3× larger than infrastructure (2.38) or business (1.09), suggesting hyper-exponential adoption dynamics.
- Franchise Model Works: McDonald's (R²=0.9293) confirms that franchise/retail expansion follows same clustered growth pattern (town-to-town, country-to-country).
- Technology vs Demographics: Network infrastructure shows power laws (R²>0.95), while demographics show S-curves (Global Population R²=0.72 with saturation effects).
🎓 Scientific Implications
For Bitcoin Analysis:
- Scale invariance is fundamental, not an artifact
- Genesis date (2009-01-03) is empirically validated as near-optimal
- Power law models provide robust valuation framework
- Network effects are genuine and quantifiable
For Cryptocurrency Research:
- Not all cryptos show this property (Ethereum R² = 0.6778)
- Property may be unique to monetary networks, not smart contracts
- Future research needed on protocol features enabling scale invariance
For Financial Theory:
- Bitcoin challenges traditional DCF models
- Network effects can dominate over extended periods
- Power law growth possible in unbounded addressable markets
📊 Key Statistics
- Number of assets tested: 8
- Total tests performed: 250+ (50 dates × 5 assets + Bitcoin)
- Random samples per test: 5,000 date pairs
- Date range tested: 1980-2025 (varies by asset)
- Statistical significance: p < 0.0001 for Bitcoin superiority
- Effect size: Cohen's d > 2.0 (very large)
🔬 Reproducibility
All code, data, and analysis is publicly available. To reproduce:
python3 scale_invariance_genesis_research.py
python3 convert_scale_invariance_to_html.py
Expected runtime: ~5-10 minutes
🚀 Future Research Directions
- Extended Asset Testing: Additional cryptocurrencies, commodities, emerging markets
- Real-Time Monitoring: Dashboard tracking scale invariance R² evolution
- Theoretical Modeling: Mathematical explanation for Bitcoin's 5.4 exponent
- Regime Change Analysis: Study periods when scale invariance weakened
- Network Metrics Integration: Correlate with active addresses, hash rate, etc.
This research provides definitive empirical evidence that Bitcoin's scale invariance is a genuinely unique property arising from its network dynamics, not an artifact of choosing the "correct" genesis date.
🔬 Bitcoin Power Law Exponent Research
⚡ NEW: Mathematical Explanation for Bitcoin's Exceptionally High Exponent (5.4-5.7)
🎯 The Question: Why is Bitcoin's power law exponent (5.4-5.7) approximately 2.8× higher than typical networks governed by Metcalfe's Law (exponent ≈ 2)?
💡 The Answer: Bitcoin has THREE compounding network effects instead of just one:
Layer 1 (Network Effects): β₁ = 2.0 ← Metcalfe's Law (V ∝ n²)
Layer 2 (Security Feedback): β₂ = 1.7 ← Hash rate amplification (H ∝ P²)
Layer 3 (Market Dynamics): β₃ = 2.0 ← Winner-take-most + unbounded market
─────
Total Predicted: β = 5.7
Measured (15+ years): β = 5.67 ← Error < 1% ✓
📘 Academic Whitepaper & FAQ
📄 Academic Whitepaper
bitcoin_power_law_exponent_theory.html
- Complete theoretical framework (11 sections)
- Mathematical derivations from first principles
- Empirical validation (R² = 0.9612, 15+ years)
- Comparative analysis with other assets
- MathJax LaTeX formula rendering
- Professional academic styling
❓ Accessible FAQ
BITCOIN_EXPONENT_EXPLAINED.html
- Plain-language explanation for everyone
- Visual breakdowns and comparisons
- Three-layer model illustrated
- Common questions answered
- Quick elevator pitch summary
- No math prerequisites required
🔬 Three-Layer CNERVF Model
Compounding Network Effects with Recursive Value Feedback (CNERVF) - A novel theoretical framework explaining Bitcoin's unique exponent:
| Layer | Mechanism | Contribution (β) |
|---|---|---|
| Layer 1: Network Effects | Metcalfe's Law - Value grows with n² (each user connects to all others) | 2.0 |
| Layer 2: Security Amplification | Hash rate feedback loop - H ∝ P², security feeds back into price (unique to PoW) | 1.7 |
| Layer 3: Market Depth | Winner-take-most dynamics + unbounded addressable market (~$100T global wealth) | 2.0 |
| TOTAL (Sum in log-space) | 5.7 | |
✅ Validation Results
- Model Prediction: β = 5.7
- Empirical Measurement: β = 5.67 (trend), 5.83 (floor), 4.90 (ceiling)
- Error: < 1% (0.5% for trend) ✓
- Fit Quality: R² = 0.9612 over 5,566 data points (15+ years)
- Stability: Exponent stable across multiple time windows
🏆 Bitcoin vs Other Assets
Bitcoin is the only asset with all three layers active:
| Asset | Exponent (β) | Has Layer 1? | Has Layer 2? | Has Layer 3? |
|---|---|---|---|---|
| Bitcoin | 5.74 | ✅ | ✅ | ✅ |
| Microsoft | 4.91 | ✅ | ❌ | Partial |
| Tesla | 5.05 | ✅ | ❌ | Partial |
| Internet Users | 2.38 | ✅ | ❌ | ❌ |
| McDonald's | 1.10 | Partial | ❌ | ❌ |
🚀 Future Price Predictions
Using β = 5.67 from the validated model:
| Year | Predicted Price | 95% Confidence Interval |
|---|---|---|
| 2026 | $172,000 | $130k - $230k |
| 2030 | $412,000 | $310k - $550k |
| 2035 | $1,383,000 | $1.04M - $1.84M |
| 2040 | $3,751,000 | $2.81M - $4.99M |
📁 Research Files & Visualizations
- bitcoin_power_law_exponent_theory.html (53KB) - Complete academic whitepaper with MathJax LaTeX rendering
- BITCOIN_EXPONENT_EXPLAINED.html (18KB) - Accessible FAQ for general audience
- bitcoin_power_law_exponent_theory.md (35KB) - Markdown source with 11 sections of rigorous analysis
- BITCOIN_EXPONENT_EXPLAINED.md (7KB) - Markdown FAQ source
- bitcoin_power_law_exponent_analysis.py (21KB) - Automated analysis and validation script
- bitcoin_power_law_exponent_analysis.png (444KB) - 6-panel comprehensive visualization:
- bitcoin_power_law_exponent_analysis_report.md (4KB) - Executive summary with validation results
- RESEARCH_SUMMARY.txt (3KB) - Quick reference card with key findings
🎓 Scientific Contributions
Novel Framework: First rigorous explanation of power law exponents > 5 in real-world networks
Cross-Disciplinary Impact:
- Network Science: Extends Metcalfe's Law to monetary networks
- Economics: Mathematical framework for cryptocurrency valuation
- Complex Systems: Demonstrates recursive feedback amplification
- Finance: Distinguishes fundamental from speculative value
Key Insight: Bitcoin's growth is mathematically grounded in network dynamics, not speculation. The three-layer mechanism explains why Bitcoin is unique among all assets analyzed.
📚 Related Research
- Scale Invariance Research: See Section 10 for comparative analysis showing Bitcoin's R² = 0.9054
- Genesis Day Hypothesis: See Section 8 for validation of January 3, 2009 start date
- Giovanni Santostasi's Work: Original discoverer of Bitcoin's power law behavior (2018)
Citation: If you use this framework in your research:
btcgraphs Research Team (2025). "Theoretical Modeling: Mathematical Explanation for Bitcoin's High Power Law Exponent." btcgraphs Technical Report Series, v1.0. https://github.com/raymondclowe/btcgraphs
📊 Rigorous Power Law Testing (Clauset-Shalizi-Newman Analysis)
Addressing Statistical Critiques: In response to Cory Klippsten's valid critique that "log-log linear regression is NOT proper power-law testing," this analysis implements the full Clauset-Shalizi-Newman (2009) methodology for rigorous power-law validation.
🔬 What Makes This Rigorous?
Unlike simple log-log regression (R² on log-transformed data), proper power-law testing requires:
- ✅ MLE exponent estimation (not OLS) using
α = 1 + n / Σ ln(x_i / x_min) - ✅ Systematic x_min selection via K-S distance minimization (not arbitrary)
- ✅ Alternative model comparison (lognormal, exponential, stretched exponential)
- ✅ K-S testing with theoretical CDF (not regression R²)
- ✅ Bootstrap p-values (parametric, 500 resamples)
⚠️ Key Finding: Distribution ≠ Trend
The Clauset test REJECTS the power-law distribution (p = 0.0000), BUT this doesn't invalidate price predictions!
Two different "power law" claims:
- Distribution power law ❌ (what Clauset tested, rejected) - "The frequency distribution of prices follows p(x) ∝ x^(-α)"
- Trend power law ✅ (what predicts prices, validated) - "Price grows over time as P(t) ∝ t^β" with R² = 0.96
Simple analogy: Distribution test failed because of Bitcoin's volatility and boom-bust cycles. But the long-term trend (15+ years, R² = 0.96) remains stable and useful for predictions. It's like your car averaging 60 mph even though the speedometer readings have high variance.
📊 Analysis Results
Three datasets analyzed with full CSN methodology:
| Dataset | p-value | Best Model | Verdict |
|---|---|---|---|
| Bitcoin Prices (raw) | 0.0000 | Exponential | ❌ Reject |
| BTC/Gold Ratio | 0.0000 | Stretched Exponential | ❌ Reject |
| Bitcoin (no booms) | 0.0000 | Stretched Exponential | ❌ Reject |
📈 What This Means for Predictions
- Distribution test failed - Bitcoin prices don't follow a pure power-law distribution (too much volatility)
- Trend still valid - The time-series trend P(t) ∝ t^5.7 with R² = 0.96 remains robust
- Use trend for forecasts - All projection tools in this repo (retirement calculator, power law trend) use the trend, not distribution. ⚠️ Note: LPPLS model has extreme window sensitivity - see sensitivity analysis below.
- Cory's critique was correct - Simple log-log regression isn't rigorous, but the trend-based predictions are still sound
📁 Files & Visualizations
- clauset_power_law_analysis.py - Full CSN implementation (1,111 lines)
- CLAUSET_POWER_LAW_ANALYSIS_REPORT.md (12KB) - Technical report addressing each critique
- Methodology explanation
- Results with all statistical tests
- Point-by-point response to critiques
- Recommendations for LPPLS models
- DISTRIBUTION_VS_TREND_EXPLAINED.md (11KB) - Simple explanation for non-statisticians
- ELI5 explanations with analogies
- Why distribution test doesn't affect predictions
- How to use trend for price forecasts
- explain_distribution_vs_trend.py - Generates explanatory visualizations
Visualizations (6-panel comprehensive analysis):
Simple Explanation Visualization:
🎯 Bottom Line
For practical Bitcoin price predictions:
- ✅ DO use: Trend analysis (R² = 0.96), retirement calculator. ⚠️ LPPLS with caution: Test multiple windows and show ranges (see sensitivity analysis)
- ❌ DON'T worry about: Distribution test results (p = 0.0000) - not relevant for forecasting
The distribution test confirms what we already knew: Bitcoin has volatility and cycles. But the long-term trend remains remarkably stable (15+ years, R² = 0.96) and is what enables all the prediction tools in this repository.
Further Reading:
- Clauset, A., Shalizi, C. R., & Newman, M. E. (2009). "Power-law distributions in empirical data." SIAM review, 51(4), 661-703.
- Distribution vs. Trend Explained - Full explanation with analogies
- Technical Report - Complete methodology and results