Synthetic Data와 JP Morgan 그리고 TimeGAN

1.
이메일뉴스레터로 받은 Risk.net. 제목이 흥미롭습니다. 기계학습모델에서 왜 데이타가 중요한지를 정리합니다.

Finance is no different. Like all machine learning models, those used in investing or hedging reflect the data they have learnt from. So comparing models that have been trained on different data can tell quants lots about the data, but far less about the models themselves. Measuring a firm’s machine learning model against other known models in the industry, or even against different models from the same organisation, becomes all but impossible.

The idea, then, is to create shared datasets that quants could use to weigh models one against another. In finance, it’s a more complex task than just collecting and labelling pictures, though. For one, banks and investing firms are reluctant to share proprietary data – sometimes due to privacy concerns, often because the data has too much commercial value. Such reticence can make collecting raw information for benchmark datasets a challenge from the start.

Secondly, the new “golden” datasets would need masses of data covering all market scenarios – including scenarios that have never actually occurred in history. This is a well-known problem affecting machine learning models that are trained on historical data.

In financial markets the future seldom looks like the past. If the dataset you train your model on resembles the data or scenarios it encounters in real life, you’re in business. If it’s significantly different, you don’t know what the model is going to do Blanka Horvath, Technical University of Munich

“If the dataset you train your model on resembles the data or scenarios it encounters in real life, you’re in business,” says Blanka Horvath, professor of mathematical finance at the Technical University of Munich.

“If it’s significantly different, you don’t know what the model is going to do.”

The solution to both problems, quants think, could be to create some of the benchmark data themselves.
Why machine learning quants need ‘golden’ datasets 중에서

그리고 대안으로 Synthetic Data를 제시합니다.

Synthesising data in this way is increasingly common in finance.

Quants say it would be too complex to formulate a universal dataset comparable to ImageNet for all types of finance models. The market patterns that would test a model that rebalances every few seconds, for example, would be different from events that would challenge a model trading on a monthly horizon.

Instead, the idea would be to create multiple sets of data, each designed to test models created for a specific use. Benchmarks could help practitioners grasp the strengths and weaknesses of models as well as whether changes to a model bring improvement or not.

Synthetic Data를 처음 접했습니다. 우리말로 합성 데이타로 번역합니다. 합성데이터를 정의한 여러 글중 하나입니다.

합성 데이터(Synthetic Data)란 실제 데이터(real-world data)에 대한 대체재로서 컴퓨터 시뮬레이션이나 알고리즘이 생성하는, 주석 정보(annotated information)입니다.다시 말하면, 합성 데이터는 실제 환경에서 수집되거나 측정되는 것이 아니라 디지털 환경에서 생성됩니다.
정확한 AI 모델을 만드는 ‘합성 데이터’ 해부하기중에서

처음에는 Synthetic Data를 재현데이터를 번역한 듯 합니다. 한국신용정보원의 경우로 재현데이터의 개념 및 활용 사례입니다.

Download (PDF, 802KB)

Maverick* Research: Forget About Your Real Data — Synthetic Data Is the Future of AI은 가트너그룹이 바라보는 Synthetic Data의 미래입니다. 참고하시면.

2.
앞서 Risk.net을 보면 미국 월스트리트도 당연히 합성데이타에 대한 관심이 높을 듯 합니다. 그중 하나가 JP Morgan입니다. Synthetic Data을 보면 J.P. Morgan AI Research가 적용하는 방법론과 과정을 상세히 소개하고 있습니다.

Step 1: Compute metrics for the real data
Step 2: Develop a Generator (may be statistical methods or an agent-based simulation)
Step 3: (Optional) Calibrate the Generator using the real data
Step 4: Run the Generator to generate synthetic data
Step 5: Compute metrics for the synthetic data
Step 6: Compare the metrics of the real data and synthetic data
Step 7: (Optional) Refine the Generator to improve against comparison metrics

위 흐름의 밑바탕이 된 방법론이 Generating synthetic data in finance: opportunities,challenges and pitfalls입니다.

Download (PDF, 202KB)

2.
조금더 깊이 들어가보겠습니다. 넓은 의미로 알고리즘트레이딩에서 Sythetic Data를 어떻게 이용하고 있는지를 확인하기 위함입니다. 처음 눈에 들어온 글은 Generating Synthetic Market Data입니다. 자주 보는 블로그이기도 합니다. 글중에서 TimeGAN이 기계학습모델로 소개합니다. 2019년 NeurIPS Proceedings에서 발표한 Time-series Generative Adversarial Networks입니다. 관련한 코드는 Codebase for “Time-series Generative Adversarial Networks (TimeGAN)”에 있습니다.

TimeGAN consists of four network components: an embedding function, recovery function, sequence generator, and sequence discriminator. The key insight is that the autoencoding components (first two) are trained jointly with the adversarial components (latter two), such that TimeGAN simultaneously learns to encode features, generate representations, and iterate across time. The embedding network provides the latent space, the adversarial network operates within this space, and the latent dynamics of both real and synthetic data are synchronized through a supervised loss.

Download (PDF, 2.7MB)

2022년 TimeGAN을 이용한 한글논문이 나왔습니다. 한국스마트미디어학회지에 실린 TimeGAN을 활용한 트레이딩 알고리즘 선택 입니다.

주식 시장에서 안정적으로 높은 수익을 얻기 위하여 많은 트레이딩 알고리즘에 대한 연구들이 이루어졌다. 트레이딩 알고리즘들이 미국 주식시장의 거래량에서 차지하는 비율은 80 프로가 넘을 정도로 많이 사용된다. 많은 연구에도 불구하고 항상 좋은 성능을 나타내는 트레이딩 알고리즘은 존재하지 않는다. 즉, 과거에 좋은 성능을 보이는 알고리즘이 미래에도 좋은 성능을 보인다는 보장이 없다. 그 이유는 주가에 영향을 주는 요인은 매우 많고, 미래의 불확실성도 존재하기 때문이다. 따라서 본 논문에서는 알고리즘들의 수익률에 대한 과거 기록을 바탕으로 미래의 수익률을 잘 예측하고 수익률도 높을 것으로 추정되는 알고리즘을 선택하는 TimeGAN을 활용한 모델을 제안한다. LSTM기법은 미래 시계열 데이터의 예측이 결정론적임에 반하여 TimeGAN은 확률적이다. TimeGAN의 확률적인 예측의 이점은 미래에 대한 불확실성을 반영하여 줄 수 있다는 점이다. 실험 결과로써, 본 논문에서 제안한 방법은 적은 변동성으로 높은 수익률을 달성하고, 여러 다수의 비교 알고리즘에 비해 우수한 결과를 보인다.

Download (PDF, 3.44MB)

앞서 JP Morgan의 논문을 보면 QuantGAN을 소개합니다. 금융분야에서 시계열데이타 생성=합성데이타 생성을 위해 GAN을 도입하는 연구가 많다는 의미입니다. 금융에서 GAN를 적용하고자 하는 연구를 정리한 Generative Adversarial Networks in finance: an overview 을 보면 다음과 같이 정리하고 있습니다.

Generative adversarial networks in time series: A survey and taxonomy은 TimeGAN와 QuantGAN외 다양한 GAN모델을 비교설명하고 있습니다.

Download (PDF, 2.74MB)

TimeGAN을 다룬 논문은 Quant GANs: Deep Generation of Financial Time Series입니다.

Download (PDF, 3.47MB)

Hands-On Machine Learning for Algorithmic Trading에서도 소개하였던 Stefan Jansen이 QuantUniversity에서 Sythetic Data Generation for Finance을 주제로 강연한 내용을 정리한 자료는 실무에 적용할 때 도움을 주리라 생각합니다.

Generative Adversarial Nets for Synthetic Time Series Data

Leave a Comment

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.