# Monte carlo method

Monte Carlo (MC) method - was developed by the team of the great Hungarian mathematician John von Neumann during World War II. John von Neumann (1903-1957) - is a Hungarian mathematician, physicist, economic theoretician, creator of the theory of games, professor of mathematics at Princeton. In the years 1943-1955 he worked on diffusion of neutrons in the Laboratory of Los Alamos von Neumann and at that time he used for the first time this approach to describe the random nature of particle movement. The name Monte Carlo was supposed to indicate the random (random, gambling) nature of phenomena.

The Monte Carlo method is used in various branches of mathematics, mathematics and numerics. It includes calculations used for randomized algorithms. It is used for mathematical modeling of too complex processes (calculations of integrals, chains of statistical processes) so that their results can be predicted using an analytical approach. This method can be used wherever the studied problem can be described theoretically in a stochastic approach, although the problem itself can be strictly deterministic. It is used especially in statistical physics and Bayesian statistics. The essence of the role in the Monte Carlo method is random sampling of the characterizing parameters of the process, this concerns both the distributions of simple or complex processes. It consists of the following main parts: the formulation of stochastic models of the studied real processes, modeling random variables with a given probability distribution, solving the statistical problem in the field of estimation theory. From a mathematical point of view, the stages of Monte Carlo algorithms are divided into ways of creating random variables, and then reducing their errors and estimating accuracy.

## Measurement of market risk - value at risk

Market risk is a consequence of changes in prices on financial markets. Classically, they are calculated using the deviation of the standard rate of return. Value at Risk is defined as the loss of value of assets such that the probability of obtaining it will be equal to the accepted level of tolerance (usually a small-number close to zero). Value at risk is higher for longer periods and its value decreases with increasing confidence level (confidence and tolerance levels add up to 100%). Value at risk is calculated using the quantile of the distribution of the rate of return. One of the following approaches is usually used to estimate it:

• method of variance-covariance - Assumes a normal distribution of rates of return.
• historical simulation method - Consists in taking into account the past rates of return of a given financial instrument. For example, the rates of return from each subsequent day are taken into account and their empirical distribution is determined on their basis. The effectiveness of this method depends on changes in the value of rates. If this has not changed in the past, this method will be less effective.
• Monte Carlo method - It is characterized by the highest level of advancement. Experiences and results from previous empirical experiences are taken into account. Based on them, using the geometric Brownian motion, a hypothetical model of the formation of these feet is created. Next, a large number of simulations of the value of return rates is created and on their basis a quantile of the distribution of the rate of return is obtained, which in turn allows to obtain value-at-risk. (K. Jujuga 2007, p. 99-104)

## The Monte Carlo method in 12 steps

The Monte Carlo method is classified into the classes of simulation methods. The Monte Carlo simulation includes twelve steps:

1. specification of the parameter being the basis for the measure of a given financial problem, e.g. profit, debt level or rate of return,
2. building a financial model of the examined problem, using mathematical relationships between the most important variables, e.g. deterministic variables accepting only one value or random variables taking many values,
3. determination of the appropriate probability distribution for each random variable,
4. the probability distribution of each random variable must be transformed into a cumulative probability distribution,
5. each value of a random variable must be assigned a corresponding random value,
6. for each random number it must be possible to generate a random number,
7. each random number must be assigned the appropriate value of a random variable,
8. the appropriate value of the random variable, determined in the previous step, must be used to determine the basic measure of a given problem,
9. the value determined in step 8 must be remembered,
10. repeating steps 6-9 many times,
11. the value of the basic measure saved from step 9 becomes the basis for determining its probability distribution and the cumulative probability distribution,
12. the cumulative probability distribution created in step 11 must be analyzed, where the parameters of the descriptive statistics are determined (A. Chyliński 1999, p. 148-149).

The main problem of solving using these methods is to determine the probabilities of any events and expected values ​​of random variables.