When it comes to predictions, artificial intelligence techniques are much more powerful than simple statistical approaches such as extrapolating simple trends. However, these methods initially only provide point predictions, while it is often desirable to also predict risks, i.e. improbable (and often adverse) possible events. Several approaches exist for this purpose, but they are either "appended" ex post to the actual AI procedure and/or are only applicable in special cases.
Here, an approach is presented with which AI procedures are generically able to "learn" risks directly. This is demonstrated with various American stock prices.
Why predict risks?
Why does it make sense at all to predict risks and not to content with point forecasts? This is simply because point predictions are either not possible or not practical in many situations. Instead, only probabilistic predictions can be made. Risks are thus omnipresent and the reasons for this are manifold.
Based on the fundamental principles of nature of quantum physics itself, it is impossible to make accurate predictions at the microscopic scale.
This is complicated by the fact that often very small initial lack of knowledge can lead to serious differences in the results; this is described by chaos theory and can be well observed in the example of the weather. In addition, highly complex systems are characterized by feedbacks. A particularly complex system is, for example, the stock market, in which the future expectations of many different players are reflected.
In this context, it is of enormous importance to quantify risks as accurately as possible, as they often have catastrophic effects. Examples include natural disasters (e.g. storms, earthquakes), economic crises, financial market turbulences (stock market crashes) or even traffic jams, operational risks, hacker attacks and terrorism.
Advantages and shortcomings of AI
Artificial intelligence methods are, of course, the contemporary means of choice for quantifying risks. After all, these are – in contrast to conventional statistics – very good methods for finding patterns in data. In particular, very precise point predictions are possible. Furthermore, these methods – if they are already trained – are very fast compared to Monte Carlo simulations and can partially replace them.
However, there is – in general and a priori – no automatic handling of risks, i.e. of different probable outcomes. Moreover, the nomenclatures and definitions of risks are inconsistent and there is often confusion between model risk, uncertainty and the inherent risk considered here; this will be discussed in more detail below.
Excursion: Necessity of an appropriate nomenclature
At this point, it is appropriate to address the different types of unknowns. This is important because both the concepts about them and the procedures for dealing with them differ fundamentally. In general, one can distinguish between
- Uncertainty: These are "unknown unknowns", i.e. unknowns that can neither be quantified nor predicted by an AI.
- Model risk: This refers to the AI process itself. It decreases with better model and data and is subject to model validation. A term used in the literature in this context is also "epistemic uncertainty".
- Inherent risk: This risk is "real-world" and can be quantified, so it is "known unknowns." Better models provide better predictions; however, the risk itself does not decrease. This risk – in the literature also known as "aleatoric uncertainty" – is the subject of this post.
Procedures used so far
A variety of procedures have been designed to mitigate the problems described, some of which vary widely in application and complexity. The following is a brief – incomplete and subjective – list of the procedures.
Self-Aware AI: Especially in novel situations it is important to have a measure about uncertainty of the AI model. This method provides that measure based on Bayes statistics. However, it does not provide risk predictions in the strict sense and is located at the gray area between unknown unknowns and known unknowns.
Restricted Boltzmann Machines: These are neural networks with a special architecture that makes it possible to "learn" distributions. These can then be reproduced and corresponding forecasts made. Inherent risks can thus be predicted directly. However, the procedure is bound to the special architecture with its related peculiarities.
Residual error analysis: The predictions are compared with real events in backtesting and the deviations (residuals) are determined. Risks are thus considered as historical model errors. As a result, model and inherent risks are sometimes mixed. Moreover, this procedure is only performed ex post and is not part of the AI model.
Probabilistic Forecasting: Here, probability scores are compared with real probabilities and the model is calibrated if necessary. A special case of this is the calibration to binary possible outcomes, as is done, for example, in the case of default probabilities when determining credit ratings. However, distribution assumptions must be made for this; moreover, this procedure is also carried out only ex post and is not part of the AI model.
Variational Autoencoders: Here, a special neural network "learns" the essential characteristics of the data that are necessary to reproduce them. By varying these characteristics, probability distributions can be generated. However, distribution assumptions must be made for this as well. In addition, the procedure is bound to the special architecture with its peculiarities in this respect.
Generative Adversarial Networks: Here, one neural network analyzes the errors of another and "learns" to reproduce the possible result space. Here, model errors are basically also mixed with inherent risks. Moreover, probabilities are only "learned" indirectly. In addition, this procedure is also bound to the special architecture with its relevant peculiarities.
Excursion: What are risks?
In the following, the method mentioned at the beginning will be discussed, with which risks can be learned directly and independent of the model. As has become apparent, it is of enormous importance to have a practicable definition of what risks are in the first place. The following approach is accordingly based on the following definition used for this purpose:
"Risk is when different outcomes are possible with the same information ( initial basis)".
Thus, for example, one has a risk that it will be colder tomorrow if one only knows what the temperature is today. No matter how good the model is, if it only has this information, it will only be able to provide an inaccurate – risky – forecast. The risk is thus considered to be part of the available information.
Chosen method: Probabilities as model parameters
In the procedure for the direct and model-independent prediction of risks, probabilities or quantiles were considered as direct model parameters, i.e., as part of the data. This allows AI models to learn probabilities – and thus risks – directly. It does not matter whether the probabilities are defined as input or output data.
Thus, no novel models or procedures are required. Instead, risks are mapped into the structure of the training data as follows:
- Given identical (or made identical by rounding) input data and multiple possible output data, the quantile serves as an additional ordering parameter, i.e., an additional data field.
- The learning of the input-output relation follows as usual in classification or regression methods. The quantile (or the probability) is just an additional variable.
- The replication of the learned distribution takes place then also with new data and given probability.
Example: American stocks
The goal of this example was to predict the distribution of the returns for the following day for shares of different large American companies on the basis of only a few input data (returns of the past 5 days).
The daily stock prices of the 20 largest American companies between 2008 and 2020 were used as the data basis. Returns were calculated from these and five input variables and one output variable were formed for each data point by windowing, i.e. the returns of the following day were to be forecast on the basis of the returns of the last five days. So far the procedure corresponded to the usual procedure for a regression.
Subsequently, however, the input data sets were grouped into 10 clusters by k-means clustering. For each cluster, the input values were then replaced by the mean values of the respective cluster. This revealed that different output data were possible for identical input data, consistent with the risk definition above. Each cluster was now sorted based on the output data and the corresponding quantile was calculated as an additional – sixth – input variable.
This data set was then used to train a five-layer neural network with dropout layers and ADAM optimization over 30 cycles, according to common practice.
The resulting network was then able to predict a corresponding return of the following day based on given returns of the last five days and a quantile. The results were all plausible. An example over several quantiles is shown in the figure below. One can clearly see that with smaller quantiles the outliers become more extreme, as is also known from real distributions. The AI model has thus learned to predict risks.
Figure 01: Returns of the following day for different quantiles with the input data [-0.8%, -0.7%, -0.1%, 0.2%, 0.8%] for the days [-1,…,-5]
Moreover, the risk increased with the time horizon considered. Finally, "shaky" (volatile) inputs yielded to broader distributions, which is also to be expected for riskier stocks.
Perspective
It has been demonstrated that, after appropriate data preparation, AI methods are generically capable of directly predicting risks. In the future, this could open up opportunities for rapid and accurate risk prediction, for example in the financial sector. Conventional complex methods such as Monte Carlo simulations could be replaced and, after appropriate extension, correlations could also be detected in the multivariate case.
Author
Dr. Dimitrios Geromichalos
Founder / CEO | RiskDataScience GmbH

Artificial intelligence (AI) generally refers to attempts to reproduce certain human decision-making structures, for example by developing an algorithm that can solve problems relatively independently. The term is also used for simulated intelligence, where often simple algorithms imitate intelligent behaviour, such as computer-controlled opponents in games.
In German-speaking countries, “artificial intelligence” is commonly translated as “künstliche Intelligenz”, which can suggest competition with human intelligence, for example in the form of a homunculus or cyborg. The term is difficult to delimit precisely because there is no exact definition of intelligence itself. Nevertheless, it is used in practice, research and science.
“Intelligence” also means information processing and intelligence gathering. As the Austrian AI expert and emeritus professor Robert Trappl observes, the Central Intelligence Agency is not named for how clever its staff are. At its core, AI deals with reproducing human-like decision structures through algorithms: a computer is programmed to solve problems independently, such as driving a car, translating texts or playing Go.
Artificial intelligence (AI) generally refers to attempts to reproduce certain human decision-making structures, for example by developing an algorithm that can solve problems relatively independently. The term is also used for simulated intelligence, where often simple algorithms imitate intelligent behaviour, such as computer-controlled opponents in games.
In German-speaking countries, “artificial intelligence” is commonly translated as “künstliche Intelligenz”, which can suggest competition with human intelligence, for example in the form of a homunculus or cyborg. The term is difficult to delimit precisely because there is no exact definition of intelligence itself. Nevertheless, it is used in practice, research and science.
“Intelligence” also means information processing and intelligence gathering. As the Austrian AI expert and emeritus professor Robert Trappl observes, the Central Intelligence Agency is not named for how clever its staff are. At its core, AI deals with reproducing human-like decision structures through algorithms: a computer is programmed to solve problems independently, such as driving a car, translating texts or playing Go.
Probability is a classification of statements and judgments according to their degree of certainty. Within mathematics, probability theory has developed as a separate field describing probabilities as mathematical objects.
Probabilities are described mathematically by numbers between 0 and 1, with zero and one being permissible values. An impossible event is assigned probability 0, and a certain event probability 1. However, the converse applies only if the number of all events is at most countably infinite. In "uncountably infinite" probability spaces, an event with probability 0 can occur and is then called almost impossible; an event with probability 1 need not occur and is then called almost certain.
In practice, different concepts of probability are distinguished, including:
- Classical concept of probability according to Laplace (symmetry principle): The probability of an event is the ratio of favorable outcomes to the total set of outcomes. For example, the probability of rolling an odd number with a six-sided die is 0,5. This corresponds to a relative frequency of 50 percent, since there are six possible outcomes (1, 2, 3, 4, 5, or 6), three of which have the stated property (1, 3, 5). This classical definition was developed by Christiaan Huygens and Jacob I Bernoulli and formulated by Laplace. The classical concept of probability provides the basis for classical probability theory.
- Subjectivist concept of probability: For one-off random events, the probability of occurrence can only be estimated, not calculated. Estimates are generally based on expert knowledge, experience and intuition. This is therefore called the subjectivist or Bayesian concept of probability, interpreting probability as a personal degree of belief.
- Frequentist concept of probability: A random experiment is repeated as often as possible. The relative frequencies of the respective elementary events are then determined. The probability of an event results from the limit of its relative frequency over a theoretically infinite number of repetitions. The law of large numbers plays a central role here. This requires the experiment to be repeatable without limit. Individual trials must also be independent of one another.
A quantile is a distribution threshold associated with a probability level α. It has the same unit as the random variable X, such as euros for losses or days for waiting times. This entry consistently uses the lower α-quantile.
General definition
F(x) = P(X ≤ x)
qα = inf { x ∈ ℝ : F(x) ≥ α }, 0 < α < 1
It is the smallest threshold where the cumulative distribution function reaches or exceeds α. This generalised inverse handles jumps and flat sections. In general:
P(X < qα) ≤ α ≤ P(X ≤ qα)
Continuous and discrete distributions
If F is continuous, F(qα) = α. If F is also strictly increasing in the relevant range, the quantile is its ordinary inverse F−1(α). A discrete CDF can jump across the requested level: for P(X=0)=0.7 and P(X=1)=0.3, q0.8=1. Then P(X<1)=0.7 and P(X≤1)=1. Exactly 80% therefore need not lie strictly below the 80th percentile.
Median, samples and risk
q0.5 is a median under this lower-quantile convention, not generally the mean. Other conventions are common when medians are not unique or sample sizes are even. Applied to the empirical CDF, the definition gives order statistic x(⌈nα⌉); software may instead use interpolated sample quantiles. State the method and level. Given a suitable loss definition, Value at Risk is a loss quantile; it does not describe the severity of losses beyond that threshold.
Enlarge graphicFictional parameters for illustration; no empirical observations.Sources and literature: Embrechts & Hofert: A note on generalized inverses; NIST: Percentiles.
Classification is supervised learning that assigns observations to discrete target classes, using labelled training examples. Binary classification has two classes; multiclass classification has more than two. Multilabel tasks allow multiple labels per observation.
Decision example
A transaction model may flag suspicious activity. It often estimates a score or probability before a threshold determines the class. Threshold choice should reflect error costs, review capacity and base rates.
Validation
A confusion matrix separates correct and incorrect decisions. For rare events, accuracy alone is insufficient; precision, recall, precision–recall curves and calibration provide complementary information. Unlike clustering, supervised classification uses target labels during training. Prediction does not establish causal explanation.
Technical reference: Methodological background
A mean summarizes values according to a specified calculation rule. Without qualification, “mean” often denotes the arithmetic mean. Geometric and harmonic means are different summaries with different conditions of use.
Arithmetic mean
x̄ = (1/n) ∑i=1n xi, n ≥ 1
For n numerical observations, x̄ is their sum divided by their count, with equal weight for each observation. Replacing one value by a value Δ higher increases x̄ by exactly Δ/n. Extreme values can therefore substantially affect the mean.
Distinction from expectation
μ = E[X], provided E[|X|] < ∞
x̄ describes observed data; μ belongs to an assumed probability model. For independent, identically distributed observations with finite E[|X|], the law of large numbers gives convergence of the sample mean to μ as the sample grows. It does not guarantee the accuracy of any single estimate.
For the empirical distribution assigning weight 1/n to each observed value, its expectation already equals x̄ exactly. It is therefore misleading to describe that empirical expectation as a different value reached only in the limit.
Enlarge graphicConstructed example: 6 is replaced by 26 and n stays 5. The mean increases by 20/5 = 4.For skewed observations the median may answer a different, more suitable question about location. Neither statistic alone describes dispersion, extreme losses or the complete distribution.
Technical reference: NIST: Measures of location. Status checked: 14 November 2026.
