litecoin-foundation / litecoin_forecasting

MIT License
0 stars 0 forks source link

👀👀 [Request for Review] #1

Open kcw-grunt opened 2 months ago

kcw-grunt commented 2 months ago

Nice @lshpaner ! Please add the list of reviewers here. There is no PR per se.
But, I can use it to promote.

lshpaner commented 2 months ago

@coblee @losh11 @DavidBurkett @wangxinxi @josikie @kcw-grunt

This is for a pending open-source Python library (main.py) that I would like to upload to PyPI. It gives users flexibility to simulate Litecoin user growth over a period of time into the future given BTC hashrate and some other cool plots. Please review functions and white paper and let me know what you all think. Thanks!!!

josikie commented 2 months ago

@lshpaner Wow! I read the white paper. That's amazing and looks so cool! I have questions.

  1. What is stochastic processes?
  2. What is stochastic noise?

Thank you!

lshpaner commented 2 months ago

@josikie Thank you for the feedback!

What is stochastic processes?

A stochastic process is a mathematical concept used to describe systems that evolve over time in a way that involves randomness or uncertainty. Unlike deterministic processes, where the future state of the system is entirely predictable given its current state, stochastic processes incorporate elements of chance.

Example Consider the stock market. The price of a stock on any given day depends on a variety of unpredictable factors, such as news, investor behavior, and economic indicators. Even though there are patterns and trends, there's an element of randomness that makes it impossible to predict with complete certainty. This makes stock prices an example of a stochastic process.

What is stochastic noise? Stochastic noise refers to the random fluctuations or variations that are inherent in a stochastic process. It's essentially the "background" randomness that affects the outcome of the process but isn't directly caused by any specific factor.

Example In the context of financial markets, stochastic noise might refer to the small, unpredictable price movements that occur due to random trades, market sentiment changes, or other minor factors. These fluctuations can obscure the underlying trends and make it harder to distinguish between true signals and random "noise."

Quick Summary

Stochastic Process: A system that evolves over time with inherent randomness. Stochastic Noise: The random fluctuations or variations within that stochastic process. These concepts are fundamental in fields like finance, physics, and even in this specific work on cryptocurrency modeling, where randomness and uncertainty play a significant role.

wangxinxi commented 2 months ago

Very impressive. Where is the visualisation?

lshpaner commented 2 months ago

Very impressive. Where is the visualisation?

@wangxinxi Thank you! As of right now, in the readme file:

https://github.com/litecoin-foundation/litecoin_analytics/blob/main/README.md

I can, however, create a jupyter notebook which will essentially be the same demo.

wangxinxi commented 2 months ago

Is there any strong correlation between hash rate and active users?

lshpaner commented 2 months ago

@wangxinxi

I went ahead and created new class for correlating actual LTC data with bitcoin hashrate --> CryptoCorrelation() which is new feature that the library will have.

If we are to look at only last 3 months worth of user data (based on active LTC user addresses from CoinMetrics), and connect this with CoinGecko's BTC hashrate, we have from 05/01/2024 - 08/01/2024, the following:

image


image


If we cast a wider net and do a look back from January 1, 2023 through January 1, 2024, the correlation increases by a whopping 42%:

image


image


That being said, below is the correlation between median predicted users and BTC hashrate (I added this as a feature inside the updated simulate_monte_carlo_growth_with_hashrate() function as well as ability lock in random state (seed) of experiment.

Given, as inputs:

    initial_users=1000,
    carrying_capacity=100000,
    base_growth_rate=0.10,
    time_steps=365,
    num_simulations=1000,

Correlation between hash rate and median user growth: 0.9235

Predicted Year over Year Growth

image

Time Median Prediction Lower 95% CI Upper 95% CI Lower 99% CI Upper 99% CI
2024-08-11 1000.000000 1000.000000 1000.000000 1000.000000 1000.000000
2024-08-12 1007.595648 987.626117 1025.924861 981.756035 1030.213331
2024-08-13 1006.114466 966.507823 1045.214634 953.698048 1057.997866
2024-08-14 1006.094482 948.750471 1065.063558 934.421504 1088.104310
2024-08-15 1010.662228 941.035548 1087.033279 914.053157 1114.865286
... ... ... ... ... ...
2025-08-07 99999.999973 99999.986887 100000.000000 99999.905807 100000.000000
2025-08-08 99999.999895 99999.932025 100000.000000 99999.186360 100000.000000
2025-08-09 99999.999943 99999.919709 100000.000000 99999.093680 100000.000000
2025-08-10 99999.999977 99999.977508 100000.000000 99999.705785 100000.000000
2025-08-11 99999.999983 99999.976671 100000.000000 99999.847955 100000.000000

Predicted Quarterly Growth

image

Time Median Prediction Lower 95% CI Upper 95% CI Lower 99% CI Upper 99% CI
0 1000.000000 1000.000000 1000.000000 1000.000000 1000.000000
1 1007.595648 987.626117 1025.924861 981.756035 1030.213331
2 1006.114466 966.507823 1045.214634 953.698048 1057.997866
3 1006.094482 948.750471 1065.063558 934.421504 1088.104310
4 1010.662228 941.035548 1087.033279 914.053157 1114.865286
... ... ... ... ... ...
361 99999.999973 99999.986887 100000.000000 99999.905807 100000.000000
362 99999.999895 99999.932025 100000.000000 99999.186360 100000.000000
363 99999.999943 99999.919709 100000.000000 99999.093680 100000.000000
364 99999.999977 99999.977508 100000.000000 99999.705785 100000.000000
365 99999.999983 99999.976671 100000.000000 99999.847955 100000.000000