Stock Prices: Predictable Patterns or Pure Chance?
Author(s): Shenggang Li
Originally published on Towards AI.
Statistical Analysis of Stock Market Trends Across Bull and Bear Phases, Uncovering When and How Market Conditions Shape Predictability
This member-only story is on us. Upgrade to access all of Medium.
Are stock prices truly random, or do hidden patterns surface under certain conditions? Traditional finance says stock prices follow a random walk — unpredictable and tough to forecast. But does this randomness hold in every scenario? Could specific conditions reveal trends?
I’ll dig into stock data from the health, energy, and tech sectors, examining randomness across various market phases — from bear to bull. Does a tech stock act differently in a bull market than energy in a downturn? And can we measure that?
This isn’t just theory. Knowing when stocks show patterns can give traders and analysts a real edge, showing when to rely on trends versus randomness. Using statistical tests and data segmentation, I’ll work to pinpoint where stocks deviate from a random walk, offering insights for strategies across investment and arbitrage.
A “random walk” is a sequence where each step is independent of the last. Imagine a stock price that takes a step up, down, or stays level purely by chance — there’s no pattern. In the simplest form, we can define this as:
where S_t is the stock price at time t, and ϵ_t… Read the full blog for free on Medium.
Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.
Published via Towards AI
Take our 90+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!
Towards AI has published Building LLMs for Production—our 470+ page guide to mastering LLMs with practical projects and expert insights!

Discover Your Dream AI Career at Towards AI Jobs
Towards AI has built a jobs board tailored specifically to Machine Learning and Data Science Jobs and Skills. Our software searches for live AI jobs each hour, labels and categorises them and makes them easily searchable. Explore over 40,000 live jobs today with Towards AI Jobs!
Note: Content contains the views of the contributing authors and not Towards AI.