File size: 1,886 Bytes
74f15a2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | ---
library_name: transformers
tags:
- time-series
- forecasting
- patchtst
- finance
- probabilistic-forecasting
datasets:
- siddharthmb/stocks-ohlcv
---
# PatchTST Cross-Sectional Return Forecast
This model is a `PatchTSTForPrediction` model trained to forecast future cross-sectional stock return distributions.
## Data
- Dataset: `siddharthmb/stocks-ohlcv`
- Source file: `ohlcv.csv`
- Tickers: `AAPL, MSFT, AMZN, GOOGL, NVDA, TSLA, AMD, INTC, ADBE, ORCL, CSCO, IBM, JPM, BAC, V, MA, AXP, JNJ, PG, KO`
- Input: past daily log returns in percentage points
- Target: future daily log returns in percentage points
- Split: chronological train / validation / test
## Model
```python
PatchTSTConfig(
context_length=512,
prediction_length=64,
num_input_channels=20,
patch_length=16,
patch_stride=8,
d_model=128,
num_hidden_layers=4,
num_attention_heads=4,
distribution_output="student_t",
loss="nll",
scaling="std",
)
```
Student-t output is used because financial returns are heavy-tailed.
## Metrics
Validation:
```json
{
"loss": 40.24222278594971,
"mae": 3.3909754753112793,
"mse": 15.027800559997559,
"directional_accuracy": 0.5080167271784233,
"flattened_ic": 0.002849485427271254,
"cross_sectional_ic": 0.008907554652154311,
"cross_sectional_rank_ic": 0.008295830343493587
}
```
Test:
```json
{
"loss": 38.46169090270996,
"mae": 3.328381299972534,
"mse": 14.407476425170898,
"directional_accuracy": 0.534091938405797,
"flattened_ic": 0.00037866420310066716,
"cross_sectional_ic": 0.00456014569165105,
"cross_sectional_rank_ic": 0.009876399072214697
}
```
NLL/loss is the primary metric because this is a probabilistic forecasting model.
## Intended Use
Research and experimentation with probabilistic multi-asset return forecasting. This is not a production trading system or investment advice.
|