• Home
  • About
  • Contact

Coffee and PI

~ Mathematics. Machine Learning. Data Science.

Coffee and PI

Category Archives: GenerativeAI

Generating Synthetic Financial Data With Generative Adversarial Neural Networks (GANs) and Transformers

02 Wednesday Jul 2025

Posted by Lucija Gregov in Artificial Intelligence, Data Science, Finance, GenerativeAI, Machine Learning, Python

≈ Leave a comment

Tags

ai, Finance, GenerativeAI, llm, Machine Learning

Introduction

Imagine you are working at a major investment bank like J.P. Morgan or Goldman Sachs, or maybe at a hedge fund, where modeling how the market behaves is critical, whether for trading strategies, risk controls, or stress scenario simulations. In these types of environments, being able to generate realistic synthetic financial time-series data isn’t just a nice-to-have – it is necessary.

Financial market data is messy: it’s high-dimensional, noisy, non-stationary, and full of seasonality and calendar effects (like month-end anomalies). Classic forecasting models often fall short here, especially when faced with outliers or structural changes in behavior.

To tackle this, I built a generative model – a GAN-based architecture specifically designed for financial time-series data:

  • The generator is a Transformer that learns to generate the next day’s features from a short rolling window of previous days.
  • The discriminator is a feedforward network that tries to tell apart real vs. generated next-day data.
  • The generator loss blends Binary Cross Entropy, MSE, and a custom volume-aware term to better handle the scale mismatch between price and volume.
  • A Gaussian noise layer is added to the generator, which helps avoid mode collapse and encourages more diverse outputs.
  • Ticker (stock name) embeddings to let the model generalize across multiple stocks while still capturing their unique behaviors.
Continue reading →

Categories

  • Artificial Intelligence (1)
  • Computational Geometry (1)
  • Data Science (1)
  • Finance (1)
  • GenerativeAI (1)
  • Machine Learning (7)
  • Mathematical Physics (3)
  • Nonlinear systems (2)
  • Python (4)
  • Solitons (3)
  • Topological Data Analysis (1)

Blog at WordPress.com.

  • Subscribe Subscribed
    • Coffee and PI
    • Already have a WordPress.com account? Log in now.
    • Coffee and PI
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar