Share to gain more social capita
Written by — Tuomas Leidén, ML Engineer
Written by — Tuomas Leidén, ML Engineer
Share to gain more social capita
Machine learning engineers, consultants, and analysts are perpetually on a quest for the perfect process to model complex phenomena. Stock analysis is a particularly fascinating beast - a unique blend of rigorous science and raw creativity. To do it well, you must analyze various scenarios and model processes that might occur in the future. Since there is no single absolute truth in this field, the most effective approach is often to compare this same "science-art cocktail" across different stocks.
This is precisely where the skills of an analyst who can code and manage development projects become invaluable. It allows for the creation of bespoke applications that skip the fluff and focus purely on what is needed to keep things simple.
Stockastat began as a hobby project born out of a specific frustration: I wanted to create detailed calculations for a stock and then seamlessly apply that same logic to others for a fair comparison. If you’ve ever tried to run complex Discounted Free Cashflow (DCF) calculations in a spreadsheet, you know how quickly it becomes clunky and unmanageable.
With Stockastat, I developed a recursive algorithm that automates these complex calculations for any stock - factoring in growth rates, peer comparisons, and custom metrics. This doesn't just speed up the workflow; it enforces a disciplined analysis process and generates readable reports that help tilt the odds in your favor. To understand the numbers, the app provides a statistical Creator’s Estimate alongside an Explanatory AI for every ticker, ensuring you always understand the 'why' behind the data.
In our current era of language models, generative AI has practically become a synonym for AI in general. However, the fundamental need to understand your models and what you are doing remains as critical as ever.
Explanatory models, the often-overlooked heroes under the AI umbrella, are beginning to reclaim the spotlight. Prediction models should not remain mysterious black boxes. By using the right tools to explain the models we create, we can better identify and reduce the mental biases that often cloud our decision-making.
The internet is flooded with free analysis, but most of it follows the same tired script: "The P/E ratio is low and the DCF says it's undervalued, so it’s a buy". But a good buy for whom? A trader with a one-year window or a retiree with a 20-year horizon?
Investment strategies are so diverse that two analyses of the same stock can be completely polarized. Often, the only difference is the investment horizon, which dictates which indicators actually matter:
Two horizons separated by just two years can lead to completely different strategies - and completely different conclusions about the same stock. Neither approach is inherently better or worse; they simply suit different temperaments and timelines. So you gotta choose your battles.
We’ve all heard the classic retrospective sales pitch:
"If you had invested 1000 euros in Microsoft ten years ago, NVIDIA five years ago, Bitcoin before anyone knew what a blockchain was, and an S&P 500 index fund ten years before the birth of Christ, you would be a multimillionaire today".
While entertaining, these stories rarely mention the specific criteria or strategy that would have led you to make those decisions at the time. Without that context, there is nothing to learn from the information. Stocks aren't only lottery tickets; they move on a complex mix of signals, probabilities, and imperfect information.
As Annie Duke put it, “Life is poker, not chess.” Outcomes always contain an element of luck. We often fall into the trap of tightly linking the quality of a result to the quality of the decision that produced it, which can distort our future choices. A bad outcome doesn’t automatically mean the decision was flawed. You may simply have landed in the tail of the probability distribution. Good analytics and sound models don’t eliminate uncertainty, but they tilt the odds in your favor over many observations.

Figure 1: Shapley analysis on features that affect beating the S&P500 in a one-year horizon. If high (red) feature values are on the right side of the zero-line, the high values of that feature are interpreted to increase the probability and vice versa.

Figure 2: Shapley analysis on features that affect beating the S&P500 in a three-year horizon. If high (red) feature values are on the right side of the zero-line, the high value of that feature is interpreted to increase the probability and vice versa.
Disclaimer: Please note that nothing in this article constitutes an investment recommendation.