That’s brilliant – this must be the first post on the forum about probabilistic MO.
I wonder if it’s possible to do something similar for other distributions (such as the Gamma or Weibull distributions)?
Aleksey Nikolayev Weibull distributions)?
Yes, of course. If the predicted value follows roughly that distribution, why not?
For the increments, you could also try the Student’s distribution instead of the normal distribution.
Evgeniy Chernish #:
Yes, of course. If the predicted value has roughly this distribution, why not?
For the increments, you could also try the Student’s distribution instead of the normal distribution.
I think I’ll have a go at it sometime for the height of the zigzag’s knee. There, for random walk, the distribution is exponential, so we need distributions on the positive half-axis that include the exponential distribution as a special case.
I could also try to incorporate a survival analysis, but I just haven’t got round to it yet.
Everything’s fine, apart from one thing. For the ‘forecast indicator’, the PLOT_SHIFT parameter (shifting the lines into the future) should have been enabled, but at the moment, instead of a forecast, only the ‘actual’ data from the historical record is being plotted. Or perhaps we have different interpretations of the term ‘forecast’.
Stanislav Korotky #:
Everything’s fine, apart from one thing. For the ‘forecast indicator’, the PLOT_SHIFT parameter (shifting the lines into the future) should have been enabled, but at the moment, instead of a forecast, only the ‘actual’ data from the historical record is being plotted. Or perhaps we have different interpretations of the term ‘forecast’.
After all, we only make forecasts one step ahead. We don’t forecast several bars ahead. Everything’s fine, apart from one thing. For the ‘forecast indicator’, the PLOT_SHIFT parameter (shifting the lines into the future) should have been enabled, but at the moment, instead of a forecast, only the ‘actual’ data from the historical record is being plotted. Or perhaps we have different interpretations of the term ‘forecast’.
Therefore, what the indicator displays are all forecasts one step ahead, based on a feature vector constructed with a shift of one bar back.
And before the forecasts are displayed, a training sample is selected, on which we train the network.
Evgeniy Chernish #:
After all, we only make forecasts one step ahead. We don’t forecast several bars ahead.
In other words, on each test bar, are we showing the predicted closing price and its range for a bar that, as it were, does not yet exist?
After all, we only make forecasts one step ahead. We don’t forecast several bars ahead.
Therefore, what the indicator displays are all forecasts one step ahead, based on a vector of features constructed with a one-bar offset to the past.
And before the forecasts are displayed, a training sample is selected, which we use to train the network.
Stanislav Korotky #:
In other words, are we showing on each test bar where the predicted closing price and its range lie for a bar that, as it were, does not yet exist?
Why ‘non-existent’? The zero bar is still forming, but we’ve already received the forecast for it when this bar opened, as a new vector of indicators has been formed. And this forecast does not change or get recalculated, as it depends on past prices, not on past and current prices. Or have I missed something, and does the code actually look into the future?
In other words, are we showing on each test bar where the predicted closing price and its range lie for a bar that, as it were, does not yet exist?
Evgeniy Chernish #:
Why ‘non-existent’? The zero bar is still forming, but we’ve already received the forecast for it when this bar opened, as a new vector of indicators has formed. And this forecast does not change or get recalculated, as the forecast depends on past prices, not on past and current prices. Or have I missed something, and does the code look into the future?
It’s highly unlikely that it’s looking into the future; I meant something else. It seems that the forecast is calculated right at the start of a new bar’s formation—that is, effectively only when the opening price of that ‘bar’ is known—which is why I described it, and I quote, as ‘virtually non-existent’.
Why ‘non-existent’? The zero bar is still forming, but we’ve already received the forecast for it when this bar opened, as a new vector of indicators has formed. And this forecast does not change or get recalculated, as the forecast depends on past prices, not on past and current prices. Or have I missed something, and does the code look into the future?
Stanislav Korotky #:
It’s unlikely to be a glimpse into the future; that’s not what I meant. Apparently, the forecast is calculated right at the start of a new bar forming, i.e. effectively only when the opening price of that ‘bar’ is known, which is why I described it, and I quote, as ‘virtually non-existent’.
Yes, that’s exactly how it’s intended
It’s unlikely to be a glimpse into the future; that’s not what I meant. Apparently, the forecast is calculated right at the start of a new bar forming, i.e. effectively only when the opening price of that ‘bar’ is known, which is why I described it, and I quote, as ‘virtually non-existent’.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Forecasting a Conditional Distribution Using MLP.
In the highly volatile and uncertain financial markets such as Forex, accurately predicting price movements remains a key challenge for traders and analysts. Traditional regression approaches based on standard loss functions such as mean squared error (MSE) or sum of squared errors (SSE) often underperform. These functions assume homoscedasticity, that is, constancy of the variance of the target variable, which rarely corresponds to the real dynamics of financial time series. To adequately model such data, an approach is required that takes into account heteroscedasticity — the variable variance of price increments that depends on the input features.
The article presents a probabilistic approach to the regression problem using a multilayer perceptron (MLP) to predict the conditional Gaussian distribution of price increments. For this purpose, we implement a custom loss function based on the Gaussian negative log-likelihood (GaussianNLLLoss).
Author: Evgeniy Chernish