This repository contains the source code, Bayesian models, and accompanying documentation for my Master's thesis.
The project investigates probabilistic ship trajectory prediction using Bayesian methods. The primary goal is to develop Bayesian models that predict future vessel trajectories while explicitly quantifying uncertainty in both observations and model parameters.
Ship trajectory prediction plays an important role in maritime applications, including traffic monitoring, collision avoidance, and autonomous navigation. However, accurately predicting vessel movements remains challenging due to various sources of uncertainty.
Traditional deterministic prediction methods typically provide only a single estimated trajectory without expressing the associated uncertainty. In many real-world applications, this lack of uncertainty estimation can reduce the reliability of decision-making.
Bayesian modeling provides a principled probabilistic framework that enables uncertainty to be explicitly incorporated into trajectory prediction by estimating full posterior distributions rather than single point estimates.
The primary objective of this Master's thesis is to develop Bayesian models for probabilistic ship trajectory prediction.
The project aims to:
- Investigate Bayesian approaches for modeling vessel trajectories.
- Develop probabilistic trajectory prediction models using Stan and CmdStanPy.
- Quantify predictive uncertainty through Bayesian inference.
- Evaluate different Bayesian modeling strategies using real-world ship trajectory data.
- Visualize and analyze probabilistic trajectory predictions.
The following software is required:
The following tools are optional:
A separate Python installation is not required. If necessary, uv downloads
and manages a compatible Python version automatically.
git clone https://github.com/cfeng-dev/ship-trajectory-prediction.git
cd ship-trajectory-predictionuv sync --lockedThis creates .venv and installs the project. No manual activation is needed
when using uv run.
- Press Ctrl + Shift + P.
- Search for Python: Select Interpreter.
- Select the interpreter inside
.venv:
# Windows
.venv\Scripts\python.exe
# macOS / Linux
.venv/bin/python
CmdStan requires a working C++17 toolchain to compile Stan models.
Windows users can install the required GNU C++ toolchain with CmdStanPy:
uv run python -m cmdstanpy.install_cxx_toolchainThis command installs the RTools/MinGW toolchain used by CmdStanPy to compile Stan models on Windows.
For macOS and Linux setup instructions, please refer to the official Stan installation guide.
Download and install the latest supported version of CmdStan:
uv run python -m cmdstanpy.install_cmdstanFor verification and Windows installation problems, see the CmdStan setup guide.