SIMULATING STOCHASTIC DIFFUSION PROCESSES AND PROCESSES WITH “MARKET” TIME

In financial mathematics and engineering, randomness is the dominant criterion that determines the inner character of markets. In this case, stochasticity, like Brownian motion, is not just a negligible correction, but a major approximation to the real process. That is, we can say that our world is not deterministic, its real nature is stochastic. The usual differential equation is only the first approximation to the description of real processes. The next step is stochastic equations and computer modeling of the stochastic processes [1]. Computer modeling of the behavior of complex stochastic systems and processes is a must-have tool for any financial analyst, and sometimes the only way to explore these systems. The model of continuous stochastic processes is used quite effectively when calculating financial formulas. For all its elegance, a model of continuous stochastic processes is rather limited model which only tries to describe a real process. In fact, the market has a disruptive dynamic, as there are periods of time when it is closed. The assumption of trade continuity over very short periods of time is also artificial. Modeling and simulation techniques of the stochastic diffusion processes have been a matter of active research in recent decades. Some of them can be found in papers of Kozachenko U.V., G. Deodatis G. and other. In context of our research we use ideas from [1; 2]. But in most publications dealing with simulation of stochastic processes the problem of computer modeling for processes with given marginal probability density and with new market time didn’t studied. The aim of the work was to construct the iterative scheme for modeling market time as a diffusion processes with a given marginal inverse gamma dis-


Introduction
In financial mathematics and engineering, randomness is the dominant criterion that determines the inner character of markets. In this case, stochasticity, like Brownian motion, is not just a negligible correction, but a major approximation to the real process. That is, we can say that our world is not deterministic, its real nature is stochastic. The usual differential equation is only the first approximation to the description of real processes. The next step is stochastic equations and computer modeling of the stochastic processes [1].
Computer modeling of the behavior of complex stochastic systems and processes is a must-have tool for any financial analyst, and sometimes the only way to explore these systems.
The model of continuous stochastic processes is used quite effectively when calculating financial formulas. For all its elegance, a model of continuous stochastic processes is rather limited model which only tries to describe a real process. In fact, the market has a disruptive dynamic, as there are periods of time when it is closed.
The assumption of trade continuity over very short periods of time is also artificial.
Modeling and simulation techniques of the stochastic diffusion processes have been a matter of active research in recent decades. Some of them can be found in papers of Kozachenko U.V., G. Deodatis G. and other. In context of our research we use ideas from [1; 2]. But in most publications dealing with simulation of stochastic processes the problem of computer modeling for processes with given marginal probability density and with new market time didn't studied.
The aim of the work was to construct the iterative scheme for modeling market time as a diffusion processes with a given marginal inverse gamma dis-tribution and then simulate a stochastic process for stock price with new market active time using Monte Carlo techniques.
In the second section we remind what is stochastic Ito process and how we can apply Monte Carlo method for simulation of the Ito processes [1; 9]. We show the idea of modeling stochastic processes using the Monte Carlo method and the iterative scheme and for demonstrating how computer modelling works. Then we simulate Ornstein-Uhlenbeck random walk for different parameters.
In the third section modeling and simulation of diffusion processes with a given marginal distribution are studied. This section is based on the paper [3], where diffusion models with linear drift and a known and prespecified marginal distribution are studied, and the diffusion coefficients corresponding a large number of common probability distributions are found explicitly. We just construct the iterative scheme for modeling diffusion processes with a given marginal inverse gamma distribution and simulate this processes for different parametries.
Forth section contents the main result and describes time-changed processes and its simulation. This section is based on the papers [4][5][6][7] where models of the generalized diffusion process with "market" time are presented. In proposed iterative scheme for stock prices we use modeling market time increments as a diffusion processes with a given marginal inverse gamma distribution.
The fifth section is devoted to estimates errors and convergence acceleration.

Stochastic Ito processes and its simulation
This paper considers a stochastic process with continuous-time and continuous-variables, because this kind of process allows to interpret the change in the stock prices in the market. A stochastic process with continuous time describes the behavior of a variable whose value changes at any time. Continuity of variables means that they can take any value within a certain range.
Stochastic equations are a very natural timecontinuous limit of the discrete random processes. When solving a continuous equation we will constantly return to its discrete analog, both for obtaining the general analytical results and for numerical modeling.
The Ito equation and its natural generalization to the systems of stochastic processes are the mathematical instruments which allow introducing randomness in the smooth dynamics of ordinary differential equations. The stochastic differential equation can be defined as a stochastic process [1; 9]: The general Ito processes are just the "deformation" of the simple Wiener random walk by the functions a(x, t) and b(x, t). The drift a(x, t) and volatility b(x, t) have simple meaning. If x is equal to x 0 in the moment of time t 0 , then the mean values of first and second powers of its change after the infinitely close interval 4t ! 0 will be equal these coefficients [1]. The processes with properties fully determined only by infinitely small local changes of first and second orders are called "diffusive".
To understand the nature of the diffusive process, random variable modeling is used. The total time interval is divided into a large number of intermediate intervals on which random trajectories are generated. This allows to estimate the future probability distribution of the variable.
The Ito equation 1 allows modeling the time dynamics of an arbitrary stochastic process by means of the iterative scheme [1]: For modeling stochastic Ito processes, the Monte Carlo method is preferred, because time depends linearly on the number of stochastic variables, not exponentially, as for other methods (for example, the method of constructing binomial trees) [2], [1]. In addition, the Monte Carlo method allows to calculate the standard deviation, as well as to take into account complex stochastic processes. The idea of modeling stochastic processes using the Monte Carlo method consists in choosing random values of process coefficients for the equation 2.
It is known that in financial mathematics Brownian motion with trend and Geometrical Brownian motion are the most widely used. But for demonstrating how computer modelling works we choose Ornstein-Uhlenbeck random walk.
Example 1. The Ornstein-Uhlenbeck process describes the random walk when x is attracted to the level determined by the constant ↵(see [1; 9]): dx = · (x ↵)dt + W. The volatility is assumed to be constant. The parameter > 0 determines the value of the "attractive force" to the equilibrium value ↵. If x ↵, the drift becomes sufficiently negative and draws the process down. As x falls below ↵, the drift becomes positive and raises x(t) up on average. Thus, an equilibrium is maintained where all values do not deviate from some ↵, which is a useful characteristic for various financial models.
Here below is an example of simulation of the Ornstein-Uhlenbeck random walk for different parameters. In both cases the value of ↵ is equal to 1. In the left figure = 0.1, = 0.1. In the right figure = 1, = 0.5.

Modeling of diffusion processes with a given marginal distribution
In the paper [3] flexible stationary diffusiontype models are developed that can fit both the marginal distribution and the correlation structure found in many time series from e.g. finance and turbulence. Diffusion models with linear drift and a known and prespecified marginal distribution are studied, and the diffusion coefficients corresponding a large number of common probability distributions are found explicitly.
Consider the stochastic differential equation of diffusion process with an exponential autocorrelation function and a specified marginal distribution suggested in Bibby's article [3] where ✓ -coefficient of the autocorrelation func-tion, µ drift coefficient and v -non-negative function calculated by the following formula: where F -is the distribution function associated with the density f . The idea is to construct a stochastic gammainverse diffusion process, because as we will see below, the design of the market time process is based on the use of diffusion processes with a prespecified marginal gamma-inverse density.
The density function for the diffusion process with a gamma-inverse distribution has the form: with µ equals to ↵ 1 and the squared diffusion coefficient is set as: In Bibby's article [3] these coefficients were already found: Then the process itself will be determined by the equation: From which we can easily build an iterative scheme: Example 2. The graph below shows a simulation of the diffusion process with a gamma-inverse distribution, the coefficients of which were calculated empirically, as random values of the student type, as the congruence of the distribution of log returns of real financial data and the theoretical Student distribution was confirmed [5]: Simulation of the generalized diffusion process with "market" time The price of underlying traded assets S(t) is the strong solution of the following stochastic differential equation (SDE) [4]: The meaning of the coefficients before dt, dT , and dW T , you can find in [8].
This model differs from the previous one in that the Brownian motion does not depend on the usual calendar time, but on some random process T t , otherwise, from market time.
Market time is a positive non-descending stochastic process with stationary increase that are subordinated to the gamma-inverse distribution. The idea of using "market" time is intuitively correct, because the change in stock prices occurs randomly, rather than at certain points in time.
The iterative scheme for this process will be the following: where µ, and ✓ are constants, " -white noise with normal standard distribution, and ⌧ is a stationary process of active time, with inverse gamma distribution, which was modeled earlier (see [4], [5], [6], [7]).

Estimates errors and convergence acceleration
The specific trajectory of the Wiener process fully determines any trajectory of a diffusion process if its changes are contained in the stochastic term of the differential equation [1]. For the processes with the exact solutions expressed explicitly using Wiener variable x = f (t, W t ), it is possible to calculate the mean absolute deviation between divergence of the exact solution and numerical one: For this purpose it is necessary to model the discrete Wiener trajectory applying the sequence of random Gauss quantities " 1 , . . . , " n and build the iteration scheme using them. For the equation dx = a (x) dt + b (x) W the basic iteration scheme we have used in the book is called "the Euler scheme": The shorter the time interval 4t is, the closer the sequence of values of the random process x k = = x (t k ) is to the continuous trajectory x exact (t k ) in the moments of time t k . While for the ordinary differential equations reducing the step of the iteration scheme to increase the solution precision is quite easy in most cases, the situation is much more difficult in the stochastic case.
In order to get the mean value of the random process with the relative precision 10 3 it is necessary to perform about 10 6 experiments. The time required is 10 3 times longer than in the deterministic case.
The situation becomes critical if in each experiment of this kind to reduce 4t, cause the number of iterations increases significantly. One method of successive approximations is obtained by the following iteration scheme: where ⌘ ⇠ N (0, 1) is the random quantity statistically independent from ".

Conclusion
Simulation of a stochastic process with active time is a new vision of how stock price behavior can be modeled so that the nature of the process is more real. In the paper simulation of a stochastic process with new market active time using Monte Carlo techniques was considered.
The iterative scheme for this process was proposed. It includes the modeling of diffusion processes with a given marginal inverse gamma distribution. The programmed model can be used to predict future time series values. The programmed model can be used to predict future time series values and to option pricing. моделювання процесiв iз заданою граничною щiльнiстю ймовiрностi та з новим ринковим часом не вивчалася.