Stock Market Modelling & Monte Carlo Simulation
Exploring stock price dynamics through time series analysis, Monte Carlo simulation, and machine learning, with implementations in Python and C++.
Overview
This personal project follows on from my internship, extending my interest in numerical methods and computational modelling to financial time series. Using LVMH shares listed on Euronext Paris as a case study, I explored how historical market data can support statistical analysis, stochastic simulation, and predictive modelling.
The project combines mathematical modelling with practical implementation. Python supports data preparation, exploratory analysis, and machine learning experiments, while C++ provides a complementary implementation environment for numerical simulation.
Objectives
- Analyse historical prices and trading volumes to explore trends, variability, and changes in market behaviour.
- Use Monte Carlo methods to investigate a range of possible stock price trajectories under chosen modelling assumptions.
- Explore regression and ensemble methods for predicting stock price evolution from historical features.
- Develop practical experience translating numerical methods into Python and C++ code.
Data & Preparation
Historical market data was retrieved using the Python
yfinance library, with LVMH as the main asset
studied. The workflow involved cleaning and organising
observations into a consistent time series suitable for
visualisation and modelling.
Prices, trading volumes, and derived features such as moving averages provided the basis for exploratory analysis and predictive experiments. Working with these data also highlighted the importance of distinguishing historical observations from the assumptions used to model future behaviour.
Modelling Approach
Exploratory Time Series Analysis
The first stage focused on understanding the observed series before fitting models. Price movements, trading activity, and moving averages were examined to describe the data and guide feature preparation.
Monte Carlo Simulation
Monte Carlo methods formed the stochastic simulation component of the project. Repeated random sampling allows a model to generate multiple possible trajectories and explore the variability of future outcomes.
This perspective complements point prediction by making uncertainty explicit. The resulting scenarios remain conditional on the model and its parameters: they illustrate possible behaviour within those assumptions rather than establish what the market will do.
Machine Learning
Predictive experiments included regression and ensemble approaches such as Random Forest. The workflow covered feature preparation, model fitting, hyperparameter tuning, and evaluation on validation data.
These experiments explored whether patterns in historical observations could provide useful predictive information, alongside the simulation-based view of stock price dynamics.
Implementation
-
Python: Data acquisition with
yfinance, preprocessing, visualisation, numerical experimentation, and machine learning. - C++: Implementation of numerical simulation components, extending the project beyond the Python workflow.
- Project organisation: Work structured around data acquisition, exploratory analysis, simulation, predictive modelling, and evaluation.
Outcomes & Learning
The project brought together financial data analysis, Monte Carlo methods, and machine learning in a practical modelling workflow. It strengthened my experience working with market data APIs and translating mathematical ideas into executable code.
Using both Python and C++ also broadened my experience implementing numerical methods across languages. As a continuation of my internship, the project provided an opportunity to develop these skills independently in a new application domain.
Limitations & Further Work
A study centred on one stock provides limited evidence about how well an approach generalises. Financial relationships can change over time, and simulation results depend on assumptions that may not capture abrupt market movements.
Further work could include chronological walk-forward evaluation, comparisons with a simple no-change forecast, testing across several assets and market periods, and benchmarking the Python and C++ simulation implementations. These extensions would help assess both predictive robustness and computational efficiency.