In his book, Neith Silver gives this example: suppose you want to place investments in several enterprises that can go bankrupt with probability . Required to assess their risks. The higher the probability of bankruptcy, the less we will invest. Conversely, if the probability of bankruptcy tends to zero, then you can invest without restrictions.
If there are 2 companies, then the likelihood that they both go bankrupt and we lose all investments . This is what standard probability theory teaches. But what will happen if businesses are connected, and the bankruptcy of one leads to the bankruptcy of another?
An extreme case is the situation when enterprises are completely dependent. The likelihood of double bankruptcy (bankrupt1 & bankrupt2) = (bankrupt 1), then the probability of losing all investments is . Risk assessment methodology has a wide variation. from 0.05 to 0.0025 and the real value depends on how correctly we estimate the connectedness of the two events. ')
In assessing investment in we have enterprises from before . That is, the maximum possible probability remains large. , and the old adage “do not put eggs in one basket” will not work if the counter with all baskets falls at once.
Thus, our estimates have a huge spread, and how much to invest remains a question. But it is necessary to consider well before investing. Neith Silver says that analysts' ignorance of these simple laws led to stock market crashes in 2008, when US rating agencies assessed risks, but did not assess the coherence of risks. What ultimately led to the domino effect, when a major player first collapsed and carried others along.
Let's try to make out this problem by solving a simple math problem after kata. Let's solve a simplified problem in order to learn how to evaluate the coherence of two events using the Bayes method using a simple example of two coins. Then mathematics ... I will try to chew, so that I can become very clear.
Let there be 2 coins and which give out 0 or 1 when throwing and one of 4 combinations per throw is possible:
Here the first digit refers to the first coin, and the second to the second. I introduced such designations for ease of presentation.
By the condition of the problem, let the first coin be independent. I.e and . And the second may be dependent, but we do not know how much. I.e depends on .
Maybe there is some kind of magnet that attracts coins, or the tossing is a cheater and a swindler, of which there is a dime a dozen. We will evaluate our ignorance in the form of probability.
To assess the connectedness, we need factual material and a model, the parameters of which will be estimated. Let's use the simplest assumptions to get a feel for the topic and build a model.
If the coins are not connected, then all four combinations will be equally probable. This is where an amendment from standard probability theory arises - such a result can be achieved with an infinite number of throws. But as in practice, the number of throws of course, we can get into a deviation from the average. For example, you can inadvertently get a series of three or five eagles when you toss coins, although on average, with an endless throwing, there will be exactly 50% of eagles and exactly 50% of tails. Deviation can be interpreted as a manifestation of connectedness, or it can be interpreted as a normal deviation of statistics from the mean. The smaller the sample, the greater the possible deviation, and therefore different assumptions can be confused.
This is where Bayesian theory comes to the rescue, which makes it possible to estimate the probability of a particular hypothesis using a finite set of data. Bayes produces the reverse process of the one with which we are accustomed to deal in probability theory. According to Bayes, the probability is estimated that our conjectures coincide with the real state of affairs, and not the probability of outcomes.
We turn to the creative process of building a model. There is a requirement for a connectedness model - at a minimum it should cover possible options. In our case, the extreme variants are complete connectedness or complete independence of the coins. That is, the model must have at least one parameter k describing the connectedness.
We describe it in the form of a coefficient . If the second coin always coincides with the first one, then 1. If the second coin always has opposite values, then . If the coins are incoherent, then . It turns out not bad - we describe a lot of options with one number. In addition, the meaning of this variable is defined as the probability of coincidence.
Let's try to estimate this number from the actual data.
Let there be a specific data set which consists of Outcomes:
At first glance, nothing says. Number of combinations:
Slowly disassemble what the Bayes formula means. Use the standard entry where the sign means the likelihood of an event if it is already known that another event has been executed.
In this case, we have a combination of continuous and discrete distributions. and are continuous distributions. BUT and are discrete. For the Bayesian formula such a combination is possible. To save time, I do not paint all the details.
If we know this probability, then we can find the value at which the probability of our hypothesis is maximum. That is, find the most likely ratio .
In the right part we have 3 members that need to be assessed. Let's analyze them.
1) It is required to know or calculate the probability of obtaining such data with a particular hypothesis . After all, even if the objects are incoherent ( ) then get the series possible, although difficult. It is much more likely to get such a combination if the coins are connected ( ). - The most important member and below we will explain how to calculate it.
2) Need to know . Here we come across a delicate moment of model construction. We do not know this function and we will build assumptions. If there is no additional knowledge, then we will assume that equally probable in the range from 0 to 1. If we had insider information, we would know more about connectedness and build a more accurate prediction. But since such information is not available, we set . Since the magnitude does not depend on then when calculating it won't matter.
3) - This is the probability to have such a data set, if all values are random. We can get this set at different with different probability. Therefore, all possible ways of obtaining a set are considered. . Since at this stage the value is still unknown , then it is necessary to integrate by . In order to understand this better, it is necessary to solve elementary problems in which a Bayesian graph is constructed, and then go from the sum to the integral. You’ll get a wolframalpha expression that looks for the maximum will not be affected, since this value is independent of .
We analyze how to calculate . Remember that the first coin is independent, and the second is dependent. Therefore, the probability of the value for the first coin will look something like this , and for the second coin so . The probability of coincidence with the first coin is equal to , and the probability of mismatch is .
Let us analyze the possible cases for one outcome:
To test we add the probabilities, we should get one . This makes me happy.
Now you can go to search for the most likely value. on the fictional data set that has already been cited above .
The probability of having such a set , reveal , simplified , generalize to arbitrary data set , .
Denote the number of matches , and the number of mismatches .
We get this generalized formula .
Those who wish can play with the schedule, introducing different exponents: a link to wolframalpha .
Since in this example , then we work directly with .
To search for the maximum differentiate and equate to zero: .
In order for the product to be equal to zero, one of the terms must be zero. We are not interested and , since there is no local maximum at these points, and the third factor indicates a local maximum, therefore .
We obtain a formula that can be used for predictions. That is, after an additional throw of the first coin, we are trying to predict the behavior of the second through . Exodus 6: 1¿
When new data is received, the formula is adjusted and refined. When obtaining insider data we will have a more accurate value. , and you can further clarify the entire chain of calculations.
Since we calculate probability, for it is desirable to analyze the mean and variance. The average can be calculated by the standard formula. But about the variance, we can say that as the amount of data increases, the peak on the graph (link above) becomes sharper, which means a more unambiguous prediction of the value .
In the above data set we have 4 matches and one mismatch. therefore . In the additional sixth throw with a probability of 80%, the second coin will coincide with the first one. Suppose we got on the first coin 1, then we have 80%, that “outcome 6” will be “11” and the remaining 20%, that “outcome 6” will be “10”. After each roll, we adjust the formula and predict the probability of still imperfect matches a step further.
On this I would like to finish my post. I will be glad to your comments.
PS This example is described to demonstrate the algorithm. Here a lot of things are not taken into account of what happens in reality. For example, when analyzing events from the real world, it will be necessary to analyze time intervals, conduct factor analysis and much more. This is the concern of professionals. It should also be philosophically noted that everything in this world is interconnected, only these connections sometimes appear and sometimes not. Therefore, it is absolutely impossible to fully take everything into account, for it would have to include all the objects of this world in the formula, even those that we do not know, and process a very large amount of factual material.