Discussing the article: "Data Science and ML (Part 48): Are Transformers a Big Deal for Trading?"

 

Check out the new article: Data Science and ML (Part 48): Are Transformers a Big Deal for Trading?.

From ChatGPT to Gemini and many model AI tools for text, image, and video generation. Transformers have rocked the AI-world. But, are they applicable in the financial (trading) space? Let's find out.

In deep learning, a transformer is an artificial neural network architecture based on the multi-head attention mechanism. This architecture was first introduced in the 2017 paper “Attention Is All You Need,” authored by eight researchers at Google. The paper presented a new model built upon the attention mechanism originally proposed by Bahdanau et al. in 2014, and it is widely regarded as a foundational contribution to modern artificial intelligence.

Transformers have achieved remarkable achievements across diverse domains. In the context of Natural Language Processing (NLP), they have proven their abilities in language translation, sentiment analysis, and text summarization. Expanding their applicability to image processing, they have been adeptly tailored for vision tasks, demonstrating success in image classification and object detection. Furthermore, their effectiveness extends to time series analysis, where their unique ability to capture long-range dependencies renders them suitable for predicting sequential data, demonstrated in tasks such as forecasting stock prices or predicting weather patterns.

Author: Omega J Msigwa

 
Hello!

You are calculating the baseline (naive) forecast incorrectly.

"The baseline model

This is a model that uses the latest known value of the target variable to generate a forecast. This gives us a simple benchmark that we aim to outperform.”


The correct baseline forecast for a stationary time series with zero autocorrelations is the mean of that series.

For a non-stationary series (such as a random walk), the correct baseline forecast is the most recent value.

In our case, the target variable is price increments; the series is approximately stationary; therefore, the model should have been compared against a forecast based on the mean, rather than on the most recent value.