Random processes are modeled using what methods. Examples of finite Markov chains

Modeling random processes- the most powerful direction in modern mathematical modeling.

An event is called random if it is reliably unpredictable. Randomness surrounds our world and most often plays a negative role in our lives. However, there are circumstances in which randomness can be useful. In complex calculations, where the desired result depends on the results of many factors, models, and measurements, it is possible to reduce the amount of calculation by using random values ​​of significant figures.

In probabilistic modeling, various methods are used that allow solving problems from various areas. The areas of application of probabilistic methods are listed below.

Method of statistical modeling: solving boundary value problems of mathematical physics, solving systems of linear algebraic equations, matrix inversion and grid methods that reduce to them for solving systems of differential equations, calculating multiple integrals, solving integral equations, problems nuclear physics, gas dynamics, filtration, heat engineering.

Simulation method: systems modeling queuing, tasks of automated control systems, automated control systems and process control systems, information security problems, modeling of complex game situations and dynamic systems.

Stochastic approximation method: recurrent algorithms for solving statistical estimation problems.

Random search method: solving optimization problems for systems that depend on a large number of parameters, finding extrema of a function of a large number of variables.

Other methods: probabilistic methods of pattern recognition, models of adaptation, training and self-learning.

In computer mathematical modeling of random processes, one cannot do without sets of so-called random numbers that satisfy a given distribution law. In fact, these numbers are generated by a computer using a specific algorithm, i.e. they are not completely random, if only because when the program is restarted with the same parameters, the sequence will repeat; such numbers are called "pseudorandom".

For a not too demanding user, the capabilities of the random number sensor (generator) built into most programming languages ​​are usually sufficient. So, in the Pascal language there is a function random, the values ​​of which are random numbers from range . Its use is usually preceded by the use of the randomize procedure, which serves to initially “set up” the sensor, i.e. receiving different sequences of random numbers for each call to the sensor. For problems whose solution requires very long uncorrelated sequences, the issue becomes more complicated and requires non-standard

      1. Features of simulation modeling of production systems

To analyze production systems that are very complex, diverse, do not have an exhaustive mathematical description, and also go through a number of stages of design, implementation and development, it is not possible to build adequate mathematical models, be they logical or numerical. It is natural here to use simulation modeling methods.

The system can be unambiguously described by a set of values ​​of production parameters characteristic of each specific state. If these values ​​are entered into the computer, then their changes during the computational process can be interpreted as simulating the transition of the system from one state to another. Under such assumptions simulation can be considered as a dynamic representation of a system by moving it from one state to another according to its characteristic operating rules.

When simulating production systems, changes in their state occur at discrete moments in time. The main concept of system simulation in this case is to display changes in its state over time. Thus, the determining factor here is the identification and unambiguous description of the states of the modeled system.

Simulation models allow, without using any analytical or other functional dependencies, to display complex objects consisting of heterogeneous elements between which there are various connections. Humans can also be included in these models.

Without fundamental complications, such models can include both deterministic and stochastic flows (material and information). Using simulation, you can display the relationships between work stations, material and product flows, vehicles and personnel.

Despite such obvious advantages, primarily consisting in the breadth and versatility of application, this method loses sight of the existence of logical connections, which excludes the possibility of complete optimization of the solutions obtained using this model. Only the possibility of selecting the best of the viewed options is guaranteed.

In practice, simulation modeling in many real cases is the only possible method of research. After developing a simulation model, computer experiments are carried out on it, which allow drawing conclusions about the behavior of the production system.

The emergence and development of computer simulation modeling methods also became possible as a result of the development of the statistical testing method, which made it possible to simulate random events and processes that occupy a large place in real production.

When compiling a simulation model and using it to model the object under study, it is necessary to solve several interrelated problems. These include:

    analysis of the simulated system and preparation of its formalized description, including identification of the information and logical structure of the system, identification of its components, selection of parameters characterizing the state of these components, development computer model a system capable of reproducing its behavior, planning an experiment to unfold events in a computer model that reflects events in the simulated system;

    development of a methodology for computer statistical experiments, including the generation of random or pseudo-random numbers, simulation of various random events, statistical data processing;

    conducting the actual computer experiment on a simulation model, including managing the parameters and variables of the model during its study on a computer.

Brief information

Random processes studied by simulation modeling (Monte Carlo method) include, in particular, processes associated with the formation and servicing of queues (the so-called processes queuing). The simplest task of this class that's how it is. There is a queuing system with one service center (a store with one salesperson, a repair area in a motor vehicle fleet, an emergency room with one doctor, a telephone exchange with one input, a server with one input channel, etc.). Clients resort to the system’s services randomly (with given function distribution of time periods between arrivals). If the system is free, it starts serving the client immediately, otherwise it puts him in a queue. The duration of service for each client is a random variable with a known distribution law.

In solving this problem, it is necessary to answer questions like “what is the probability distribution function of the customer’s waiting time in the queue?” “what is the downtime of the system waiting for clients?”, “if these functions themselves are difficult to determine, then what are their most important characteristics(i.e. mathematical expectation, variance, etc.)?

The basis of this task is the random process of clients entering the service system. The intervals between the arrivals of any consecutive pair of clients are independent random events distributed according to some law. The real character of this law can only be established through numerous observations; As the simplest model probability density function, we can take an equiprobable distribution in the time range from 0 to some T - the maximum possible interval between the arrivals of two consecutive customers. With this distribution, the probability that 1 minute, 3 minutes or 8 minutes will pass between the arrivals of two customers is the same (if T> 8 min).

Such a distribution, of course, is unrealistic; In reality, for most queuing processes the distribution function grows from t= 0, has a maximum at a certain value t = τ and quickly decreases at large t, those. has the form shown in Fig. 7.6.

Of course, you can choose a lot elementary functions, having qualitatively this appearance. In queuing theory, the family of Poisson functions is widely used

Where λ - some constant p - arbitrary integer.

Functions (35) have a maximum at x = p/λ and normalized.

The second random process in this problem, which is in no way connected with the first, is determined by the sequence of random events - the duration of service for each customer. The probability distribution of service duration has the same quality look, as in the previous case.

For example, in the table in the column A random numbers are recorded - intervals between client arrivals (in minutes), in the column IN - random numbers - duration of service (in minutes). Taken for definiteness a max= 10 and b max= 5.

Rice. .6. Schematic representation of the probability density of the time distribution between customer appearances in a queuing system

From this short table, of course, it is impossible to establish which distribution laws are accepted for the quantities A And IN. The remaining columns are provided for ease of analysis; the numbers included in them are found by elementary calculation. Column C shows conditional time client arrival; D- moment of service start; E - end of service; F- the length of time the client spent in the system as a whole; G- time spent in line waiting for service; N - time spent by the system waiting for clients (if there are none). It is convenient to fill out the table horizontally, moving from line to line. Since the start of servicing the next client is determined either by the time of his arrival, if the system is not busy, or by the time of departure of the previous client, we present for convenience corresponding formulas(in them i= 1, 2, 3, ...):

c 1 = 0, c i+1 = c i + a i+1 ; d 1 = 0, d i+1 = max(c i+l, e i);(36a)

e 1 = b 1 e i = d i + b i ; f i = e i + c i ; g 1 = 0; g i+1 = f i+1 + b i+1 h 1 = 0; h i+1 = d i+1 - e i(36b)

Thus, given the random sets of numbers in columns A and B, clients had to stand in line (column G), and the system was idle waiting for the client (column N).

No. A IN WITH D E F G N
1-

When modeling systems of this type, the first question that arises is, what is the average time you have to wait in line? It seems easy to answer - you just have to find

(37)

in some series of tests. Similarly, you can find the average value of h . It is more difficult to answer the question about the reliability of the results obtained; To do this, you need to conduct several series of tests and use standard methods mathematical statistics (processing using the Student distribution is often appropriate).

More difficult question- what is the distribution of random variables G And N at given distributions random variables A And IN? You can try to get a qualitative answer to this by constructing corresponding histograms based on the simulation results. Then some hypothesis is made about the type of distribution and one or more statistical criteria are used to test the reliability of this hypothesis.

Having a distribution function (even an empirical one, but quite reliable), it is possible to answer any question about the nature of the process of waiting in line. For example: what is the probability of waiting longer T minutes? The answer will be obtained if we find the area ratio curved trapezoid, limited by schedule distribution density, straight x = t And y=0 area of ​​the entire figure.

Security questions

1. What is a “random process”?

2. What are the principles of computer generation of uniformly distributed random numbers?

3. How can you obtain a sequence of random numbers with a Poisson distribution law?

4. What is a “queuing system”? Give examples.

5. What is the Monte Carlo method for calculating areas flat figures? volumes of bodies?

6. What examples of random processes can you give?

Topics for essays

1. Principles of computer generation of sequences of random numbers and statistical criteria determining the properties of sequences.

2. Methods statistical processing results obtained from computer modeling of random processes.

Subject seminars

Obtaining sequences of random numbers with a given distribution law.

Laboratory work

1. When performing this work, it is necessary to generate long sequences of pseudorandom numbers with a given probability distribution law. It can be based on a standard sensor of uniformly distributed random numbers, built into the applied programming system, using one of the procedures for converting this sequence into a sequence with the desired distribution law (for example, the “selection-rejection” procedure).

2. One of the central tasks in modeling random processes is finding the characteristics of random variables that are the object of modeling. The main such characteristic is the distribution function. Its appearance can be qualitatively assessed from the histogram constructed during the simulation, and the hypothesis about functional form check using one of the standard criteria used in mathematical statistics(for example, criterion % 2). However, this is not always advisable, especially if the problem requires determining only some characteristics of a random variable - most often the mean value and variance. They can be found without modeling the distribution function itself. At the same time statistical evaluation the reliability of the results is mandatory.

3. It is appropriate to display the simulation results on the computer screen in the following form: in the form of tables of values ​​of the calculated value (usually in several samples), in the form of histograms of the distribution of random variables constructed during the simulation.

4. It is advisable, where possible, to accompany simulation modeling with a visual display of the corresponding process on the computer screen (the process of queue formation, the birth and disappearance of objects in population modeling problems, etc.).

Approximate completion time 16 hours.

Assignment to laboratory work

Carry out a simulation of the specified random process and evaluate the reliability of the results obtained using statistical criteria.

Task options

Option 1

Simulate a queue in a store with one seller under equiprobable distribution laws of the random variables described above: the arrival of customers and the duration of service (for a certain fixed set of parameters). Obtain stable characteristics: average values ​​of waiting in line by the buyer and idle time of the seller while waiting for the arrival of buyers. Assess their reliability. Assess the nature of the distribution function of quantities g And h.

Option 2

Carry out the same modeling with Poisson laws of probability distribution of input events: the arrival of customers and the duration of service (for a certain fixed set of parameters).

Option 3

Carry out the same modeling under the normal law of probability distribution of input events: the arrival of customers and the duration of service (for a certain fixed set of parameters).

Option 4

In the system discussed above, a critical situation may arise when the queue grows without limit over time. In fact, if customers enter the store very often (or the seller is too slow), the queue begins to grow, and in the system under consideration with final time service crisis will come.

Construct a relationship between the quantities (a max, b max), reflecting the border of the specified critical situation, with an equally probable distribution of input events.

Option 5

On intercity telephone exchange two telephone operators serve a common queue of orders. The next order is served by the telephone operator who was the first to become available. If both are busy at the time the order is received, the call is canceled and you need to call again. Model the process, considering the input flows to be Poisson.

Option 6

Simulate the situation described in the previous version, but assume that if at the time of trying to place an order both telephone operators are busy, a queue is formed.

Option 7

Let the telephone exchange with one input be used conventional system: if the subscriber is busy, then the queue is not formed and you must call again. Simulate the situation: three subscribers try to call the same number owner and, if successful, talk to him for some (random in duration) time. What is the probability that someone trying to call will not be able to do so in certain time T?

Option 8

Simulate the situation described in the previous version, but assume that if at the time of the attempt to contact the subscriber’s phone is busy, a queue is formed.

Option 9

There is only one doctor working at the emergency room. The duration of treatment of the patient and the time intervals between admissions of patients - random variables, distributed according to the Poisson law. According to the severity of injuries, patients are divided into three categories; admission of a patient of any category - random event with equal probability distribution. The doctor first treats patients with the most severe injuries (in the order of their admission), then, if there are none, patients with moderate injuries (in the order of their admission), and only then - patients with minor injuries. Model the process and estimate the average waiting times in the queue for patients of each category.

Option 10

Simulate the situation described in the previous version, provided that two doctors work in the emergency room, and patients are divided into two categories rather than three.

Option 11

One weaver serves a group of looms, carrying out short-term interventions as needed, the duration of which is a random variable. What is the probability of downtime of two machines at once? How long is the average downtime of one machine?

Option 12

Simulate the situation described in the previous version, if a group of looms is jointly served by two weavers.

Option 13

IN The city motor vehicle fleet has two repair zones. One - serves repairs of short and average duration, the other - medium and long-term (i.e., medium-term repairs can be carried out by each of the zones). As breakdowns occur, vehicles are delivered to the fleet; time interval between deliveries - random Poisson value. The repair duration is a random variable with a normal distribution law. Model the described system. What are the average waiting times for vehicles requiring short-term, medium-term and long-term repairs, respectively?

Option 14

Implement a simulation model of statistical modeling to solve Buffon's problem (XVIII century). The author analytically found that if on a field graphed by parallel lines, the distance between them L, throws a needle at random l, then the probability that the needle will cross at least one straight line is determined by the formula .

This problem provided a way to simulate the determination of the number p. Indeed, if L = 2l, That . During the simulation, perform this calculation.

Option 15

Develop a one-dimensional random walk model (the “drunkard” model). The walk is set according to the rule: if the random number from the segment is less than 0.5, then a step is taken to the right by a distance h, otherwise - left. The distribution of random numbers is assumed to be equally probable.

Solve the problem: what is the probability for such a walk to move away from the starting point by n steps?

Option 16

IN conditions of the problem from the previous version, get an answer to the question: what is the probability of a “drunkard” returning after n steps in starting point?

Option 17

A point randomly wanders on a plane along the nodes of a square grid with the ability to do equal probability steps left-right-up-down at a fixed (in one move) step. The movement occurs in a closed rectangular volume, and upon contact with the wall occurs mirror image from her.

During the simulation, answer the question: how is the frequency of visits to each node related to the distance from it to the node from which the movement begins.

Option 18

Model the same situation as in the task for option 17, provided that the area of ​​wandering is unlimited and answer the question asked.

Option 19

Simulate the flight of a bee. On a plane (clearing) honey plants grow randomly with a given concentration (per 1 m2). In the center is a hive from which a bee flies out. A bee can fly from one plant to any other plant, but the probability of choice decreases monotonically with increasing distance between plants (according to some law). What is the probability of a bee visiting a specific given plant during a given number of elementary flights?

Option 20

Implement a flat model Brownian motion n particles in a rectangle. Consider the particles to be balls of finite size. Impacts of particles on each other and on walls should be modeled as absolutely elastic. Determine in this model the dependence of the gas pressure on the walls on the number of particles.

Option 21

Develop in detail and implement a model of mixing (diffusion) of gases in a closed vessel. IN starting moment time, each gas occupies half the vessel. Using this model, study the dependence of the diffusion rate on various input parameters.

Option 22

Implement a simulation model of the “predator-prey” system according to the following scheme.

The 20x20 “island” is inhabited by wild rabbits, wolves and she-wolves. There are several representatives of each species. Rabbits at each moment of time with the same probability of 1/9 move to one of eight neighboring squares (with the exception of areas limited coastline) or just sit motionless. Each rabbit has a 0.2 probability of turning into two rabbits. Each she-wolf moves randomly until the rabbit she is hunting is in one of the adjacent eight squares. If the she-wolf and the rabbit are in the same square, the she-wolf eats the rabbit and gets one point. Otherwise, she loses 0.1 points.

Wolves and she-wolves with zero points die. At the initial moment of time, all wolves and she-wolves have 1 point. The wolf behaves like a she-wolf until all the rabbits in the neighboring squares disappear; then, if the she-wolf is in one of the eight nearby squares, the wolf chases her.

If a wolf and a she-wolf are in the same square and there is no rabbit to eat, they will produce offspring of a random gender.

Observe population changes over a period of time. Monitor how changes in model parameters affect the evolution of populations.

Option 23

To model the process of spread of ringworm infection over an area of ​​skin the size n x p(p- odd) cells.

It is assumed that the original infected skin cell is the central one. At each time interval, an infected cell can infect any neighboring healthy cell with a probability of 0.5. After six units of time, the infected cell becomes immune to infection, the resulting immunity lasts for the next four units of time, and then the cell turns out to be healthy. During the simulation of the described process, output current state simulated skin area at each time interval, noting infected, resistant to infection and healthy cells.

Observe how changes in field size and the probability of infection affect the simulation results.

Option 24

Develop in detail and implement a model for the distribution of pollutants environment particles of a substance emitted into the atmosphere by a factory chimney (for example, ash resulting from the combustion of coal in a power plant). Consider the motion of a particle to consist of two components: in horizontal plane- under the influence of random gusts of wind, in the vertical - under the influence of gravity.

Further reading

1. Bailey N. Statistical methods in biology: Transl. from English - M.: IL, 1962.

2. Gnedenko B.V., Kovalenko I.N. Introduction to queuing theory. - M.: Nauka, 1966.

3. Saati T. Elements of queuing theory and its applications: Transl. from English - M.: Sov. radio, 1991.

4. Shannon R. Simulation modeling of systems - art and science: Transl. from English - M.: Mir, 1978.

Tests for Chapter 7

Let's consider algorithms for modeling stationary normal and Markov random processes. These processes are widely used as mathematical models various kinds of real processes occurring in complex technical systems. Below we present some essential definitions and concepts adopted within the framework of correlation and spectral theories random functions.

Random function called a function of a non-random argument t, which for each fixed value of the argument is a random variable. Random function time called random process. Random function coordinates points in space are called random field. Specific view, accepted by a random process as a result of experience, is called the realization (trajectory) of the random process. All obtained realizations of a random process constitute an ensemble of realizations. The values ​​of realizations at specific times (time sections) are called instantaneous values ​​of the random process.

Let us introduce the following notation: X(t) - random process; x i (t) - i-th implementation of the process X(t); x i (t j) - instantaneous value of the process X(t), corresponding to the i-th implementation at the j-th moment of time. The set of instantaneous values ​​corresponding to the values ​​of different implementations at the same moment of time t j will be called the j-th sequence of the process X(t) and denoted by x(t j). From the above it follows that the arguments of a random process can be time and the implementation number. In this regard, two approaches to studying the properties of a random process are legitimate: the first is based on the analysis of a set of implementations, the second operates with a set of sequences - time sections. The presence or absence of dependence of the values ​​of the probabilistic characteristics of a random process on time or the number of implementation determines such fundamental properties process, such as stationarity and ergodicity. Stationary the process is called probabilistic characteristics which does not depend on time. Ergodic is a process whose probabilistic characteristics do not depend on the implementation number.

The random process is called normal(or Gaussian) process, if one-dimensional and two-dimensional laws the distributions of any of its sections are normal. The comprehensive characteristics of a normal random process are its mathematical expectation and correlation function. For a stationary normal random process, the MOF is constant, and the correlation function depends only on the difference between the moments of time for which the ordinates of the random process are taken ( =t 2 -t 1). For a stationary random process, if the deviation of the ordinate of the random process X(t 2) from its mathematical expectation m x at time t 2 is sufficiently large, it becomes practically independent of the value of this deviation at time t 1. In this case, the correlation function K(t), which gives the value of the moment of connection between X(t 2) and X(t 1), will tend to zero. Therefore, K() can either decrease monotonically, as shown in Fig. 2.2, or have the form shown in Fig. 2.3. A function of the form (Fig. 2.2.), as a rule, is approximated by the expressions:


(2.38)

and a function of the form (Fig. 2.3.) - with expressions:

Fig.2.2. Fig.2.3.

The stability of a stationary random process in time allows us to replace the argument - time - with some auxiliary variable, which in many applications has the dimension of frequency. This replacement allows you to significantly simplify calculations and achieve greater clarity of results. The resulting function (S()) is called the spectral density of a stationary random process and is mutually related to the correlation function inverse transformations Fourier:

(2.42)

(2.43)

There are other normalizations of spectral density, for example:

(2.44)

Based on Fourier transforms, it is easy to obtain, for example, for a random process with K(t) of the form (2.38):

(2.45)

A stationary random process whose spectral density is constant (S(w)=S=const) is called stationary white noise. The correlation function of stationary white noise is equal to zero for all , which means that any two of its sections are uncorrelated.

The problem of modeling a stationary normal random process (SNSP) can be formulated as the problem of finding an algorithm that makes it possible to obtain discrete implementations of this process on a computer. Process X(t) is replaced with a given accuracy by the corresponding process X(nDt) with discrete time t n = nDt (Dt is the process sampling step, n is an integer argument). As a result, the random process x(t) will be associated with random sequences:

x k [n]=x k (nDt), (2.46)

where k is the implementation number.

Obviously, an arbitrary member of a random sequence x(nDt) can be considered as a random function of its number, i.e. integer argument n and, thus, exclude Dt from consideration, which is taken into account when writing (2.46). In addition, to distinguish an integer argument from a continuously varying one, it is enclosed in square brackets.

Often random sequences are called discrete random processes or time series.

It is known that adding a non-random variable to a random function does not change the value of the correlation function. Therefore, in practice, centered random processes are very often modeled (the MOR is equal to zero), from which one can always move to the real one by adding the MOR to the members of the random sequence simulating the random process.

For random sequences, the correlation function and spectral density are calculated from the dependencies:

(2.47)

(2.48)

Reducing a random process to a random sequence essentially means replacing it with a multidimensional vector. Therefore, the considered method of modeling random vectors is, generally speaking, suitable for modeling random processes specified over a finite time interval. However, for stationary normal random processes there are more effective methods construction of modeling algorithms. Let's consider two methods that are most widely used in practice.

Methods for modeling random processes and fields. The statistical modeling method (Monte Carlo method) as applied to computer modeling of random processes and fields is to solve the problem of reproducing discrete sequences that simulate continuous random functions with given probabilistic characteristics.

Let us limit ourselves to considering the most commonly used algorithms for modeling stationary Gaussian scalar processes and fields. We will consider all the processes and fields under consideration to be centered.

There are two types of algorithms with the help of which discrete implementations of a random process can be generated on a computer. Algorithms of the first type involve the calculation of a discrete sequence of values, i.e., the values ​​of process implementations in a set of pre-selected moments in time. The discretization step is usually taken to be constant: then from the stationarity of the process follows the stationarity of the sequence

Algorithms of this type are based on the linear transformation of a stationary sequence of independent Gaussian numbers with parameters into a sequence correlated according to a given law

where is the correlation function of the modeled process. In this case, the operator of the corresponding linear transformation written or as a sliding summation with weight

or in the form of a recurrent equation like

The type of correlation function of the random process reproduced using relations (49), (50) determines the set of coefficient values.

The second type includes algorithms based on the representation of simulated processes in the form of expansions

where is some system of deterministic functions; random vector. In this case, modeling a random process is reduced to reproducing the implementations of vectors and subsequent calculation of values ​​according to

formula (51). Algorithms for modeling random vectors within the framework of correlation theory can be found, for example, in.

The goal of statistical modeling of random fields is to reproduce a set of realizations of field values ​​at discrete points

In what follows, we will not make a formal distinction between spatial coordinates and time and will restrict ourselves to the case of homogeneous random fields. Algorithms for modeling random fields, as a rule, are a generalization of the corresponding algorithms for modeling random processes in the case of variables.

Simulation of Gaussian white noise. At statistical modeling random processes and fields, there is a need to model a stationary delta-correlated Gaussian process (intensity white noise or its multidimensional analogue. On a computer, only a truncated white noise with finite dispersion, the spectral density and correlation function of which are given in Table. 1 The modeling parameter is selected in such a way that the sequence is uncorrelated. This condition will be satisfied if you choose where the sampling step is. The modeling algorithm has the form

Moving summation method for modeling random processes. Algorithm (49) allows you to reproduce sequences on a computer as desired long length, which from the very beginning have the property of stationarity. Weighting factors can be calculated in various ways. An effective method is based on the Fourier series expansion of the spectral density of the simulated process. Transformation (49) is taken in the form

and the coefficients

The sampling step and the number of terms of the series are selected from the condition

where is the permissible error;

Modeling of stationary random processes with fractional-rational spectral density. To simulate random processes with fractional-rational spectral density (see Table 1, processes No. 3, 4, 7, 8) of the form

where the polynomials are relative to the order; therefore, an algorithm of type (50) is effective. Spectral Density sequences

can be reduced to the form

The coefficients are used in recurrence equations (50). Relations (50) make it possible to obtain discrete implementations of random processes of arbitrarily large length. Initial conditions in (50), when calculating the first values ​​of the sequence, you can choose arbitrary ones (for example, zero). As a result, a transition process occurs, within which initial section the generated implementation will be distorted. The size of this sales area depends on correlation properties simulated process.

Modeling random processes using canonical expansion. For stationary Gaussian random processes, an expansion similar to (19) is valid:

where are independent and stochastically orthogonal random functions. Assuming that for and replacing the integral final amount, we get

Here are Gaussian random variables with the following probabilistic characteristics:

The number of terms of the series (58) is selected from the condition

Along with (58), one can use the expansion

Realizations obtained using expressions (58), (59) are periodic and therefore do not have the ergodicity property. General dignity expansions (58) and (59) - the simplicity of the modeling algorithm, and the disadvantage is the need to take into account large number members of the series.

Expansions (58) and (59) are convenient to use to obtain discrete implementations of random processes at unequally spaced points.

Other methods for modeling random processes. In many cases, a modeling method based on the use of decomposition turns out to be effective

Here are random variables with joint density probabilities

According to the central limit theorem, the distribution of realizations (60) at tends to Gaussian. In addition, when implemented they will be asymptotically ergodic with respect to mathematical expectation and correlation function.

Along with (60), one can use the expansion

Here random variables with joint probability density

In addition, the Law of distribution of quantities can be assumed to be uniform over the interval (0,1), while their implementations are modeled using the relations

Here are random numbers, uniformly distributed over the interval (0,1), which are generated on a computer using software sensors. Modeling of implementations is carried out using one of the methods of modeling random values ​​with a given distribution law. Corresponding algorithms can be found, for example, in.

In table Table 2 shows the most common types of correlation functions of stationary random processes and the corresponding modeling algorithms.

Moving summation methods for modeling random fields. Algorithms of this type are associated with the transformation of a homogeneous delta-correlated field into a field with a given correlation function This transformation has the form

The Green's function is found from the equation

(see scan)

Discrete implementations of the field are reproduced using the sliding summation formula

Here is a constant determined by the choice of sampling step; - discrete values the implementation fields of which are reproduced using a formula like (52).

Further ways of imitation

imitate- means getting closer to real objects with specific (real) laws of behavior, adding randomness to the process.

Differential equations everything is averaged out completely. Differential equations are fundamentally deterministic. They are very good because they give an integral characteristic (as a whole).

But this is only the first step towards the study of real systems. In a real system, the researcher is interested in the particulars.

1st way. Transition to difference equations(this method was actively used to develop numerical methods DE solutions). The method is called process discretization.

We have a remote control system

.

We replace

infinitesimal interval into small one.

We calculate each next value through previous ones.

Here we must keep in mind that the coefficients already have a different dimension (and meaning) and depend on the size of the time interval through which the values ​​are recalculated.

Implementation of a discrete process in the MVS environment - using a node with empty behavior and cyclic transition arcs.

Rice. 1. Implementation of a discrete process

The time diagram of a discrete process has the form of a piecewise constant function with jumps (discontinuities) at points t i recalculation of values.

So we replaced continuous model discrete with piecewise continuous function, which shows jumps in numbers at certain intervals.

2nd way. Description local laws behavior

Let us divide the law of change in the quantity of a product into two behaviors: the law of product loss, the law of product growth

Likewise for resource

Rice. 2. Structural model with local laws

3rd way. Adding randomness

To introduce randomness, we will calculate new coefficient values ​​at each iteration like some random numbers distributed, to a first approximation, over normal law with a given mean (expectation) and variance.

And if we also take into account local behaviors decline and growth, then you can set the probabilities of transitions according to one or the other law.

And due to probabilities, we will be able to tune and explore this model.

Thus, the main ways to bring the model closer to the real system are:

  • detailing the system structure;
  • transition to discrete processes;
  • detailed behavior;
  • transition to random processes.

The combination of all these methods is simulation modeling (the real one).

Now they use something else modern nameagent-based modeling . This is actually classic statistical modeling.

There are two approaches to modeling.

First: from object to model (we determine the state real system at the initial moment of time and simulate what will happen next).

There may be the opposite situation: from model to object (we build a model, study, at what probabilities and initial values the picture will be stable or unstable, and we issue recommendations)

Thus the cycle Data Model Processing New Data takes place.

When detailing a system, we set not mathematical laws, but specific (behavioral) or, in other words, local interactions of parts of the system with each other.

On the 1st measure there is an initial random distribution the probability of an element being in a particular state.

We repeat the process cyclically. This is called agent-based or simulation modeling.

In this case, we obtain discrete (piecewise constant) functions.

Modeling of random processes

Markov processes

Function X(t) called random , if its value for any argument is a random variable.

Random function X(t), whose argument is time, is called random process .

A random process occurring in a system S, called Markovian (or a process without aftereffect), if it has the following property: for any moment in time t 0, the probability of any state of the system in the future (with t > t 0) depends only on its state in the present (with t = t 0) and does not depend on when and how the system S came to this state.

Markov processes are a special type of random processes. A special place Markov processes among other classes of random processes is due to the following circumstances:

  • For Markov processes, a well-developed mathematical apparatus allows solving many practical problems;
  • With the help of Markov processes one can describe (exactly or approximately) the behavior of fairly complex systems.

Classification of Markov processes

Classification of Markov random processes is carried out depending on the continuity or discreteness of the set of function values X(t) and parameter t.

There are the following main types of Markov random processes:

  • with discrete states and discrete time (Markov chain);
  • with continuous states and discrete time (Markov sequences);
  • with discrete states and continuous time(continuous Markov chain);
  • With continuous state and continuous time.

We will study processes with discrete states that are most suitable for modeling economic processes.

State graph

Markov processes with discrete states are conveniently illustrated using the so-called state graph, where states are indicated by circles S i systems S, and the arrows indicate possible transitions from state to state. The graph marks only direct transitions, and not transitions through other states. Possible delays in the previous state are depicted as a “loop,” i.e., an arrow directed from this state into him.

Rice. 3. State graph

There can be a finite number of states or an infinite but countable number.

A Markov random process with discrete states and discrete time is called Markov chain . For such a process, moments t 1, t 2,…. when system S can change its state, it is considered as sequential steps process, and the argument on which the process depends is not the time t, but the step number 1, 2,..., k,... The random process in this case is characterized by a sequence of states S(0), S(1), S(2),..., S(k),..., where S(0) is the initial state of the system (before the first step); S(1)– state of the system after the first step; S(k)– state of the system after the kth step...

Sequence of states S(1), S(2),..., S(k) can be viewed as a sequence of random events.

Let us denote the probability of being after k th step in state S k . Then

Of practical interest are systems with finite number states S i (i =1,…, n).

Examples of finite Markov chains

Example 1. Model 4 “Garage”

Cars in the garage can be in two states: working (1) and repair (2).

We will monitor the condition of the cars at regular intervals. For example, once a day (in the morning, before starting work), the condition of each vehicle is determined. The following situations are possible:

  • the vehicle was and remains serviceable;
  • the car was faulty and became operational;
  • the car was in good working order and became faulty;
  • the car was faulty and remained faulty.

Let's draw a graph of states and transitions of this system

Rice. 4

p 11 , p 12 , p 21 , p 22 , are the probabilities of transitions from state to state.

If the type of cars is the same, then all probabilities will be the same for all cars.

Let's represent the probabilities in the form of a matrix

Called transition matrix .

Transition Matrix Properties

  1. Each line characterizes the selected state of the system, and its elements represent the probabilities of all possible transitions in one step from the selected one (from i th) state, including the transition into oneself.
  2. The elements of the columns show the probabilities of all possible transitions of the system in one step to a given one ( j-f) state (in other words, the row characterizes the probability of the system transitioning from a state, the column - to a state).
  3. The sum of the probabilities of each line is equal to one, since the transitions form full group incompatible events.
  4. Along the main diagonal of the transition probability matrix are the probabilities Pii that the system will not exit the state i, but will remain in it.

Let's introduce the vector – k=0,1,2,3...a function that calculates the probability at each step (cycle) to remain in one of two states.

Vector of initial state probabilities for each machine. For example, we can assume that in the initial state the machine is reliably serviceable, then .

Let us describe this process in the form of a tree

In addition, at the first step, the probability of the initial state is added (set).

If you fix k=const, then we know all the final outcomes of the system. If the probabilities p ij=const, then this process is a Markov chain. This model implements an endless process. During long-term operation of the system, it may turn out that the probabilities of states tend to a certain number. These marginal probabilities called probabilities of the steady process . When modeling infinite processes, it is of interest to calculate the probabilities of a steady-state process.

Example 2. Model 5 “Cube and Coins”

There are two coins A and B and a cube K. One has a coat of arms and heads, and the other has both heads.

Game: choose a coin at random and toss it. If the coat of arms comes up, we throw the die, if it comes up heads, we throw the same coin again.

Let's draw a graph of game states

The space of outcomes is finite. All probabilities are fixed. This is a Markov chain. In this model, it can be seen that the process ends sooner or later if coin A is chosen at random. If coin B was chosen, then the process is endless.

Assignment for independent work

Create a transition matrix for this system.

Example 3. Model 6 “Game”

There are 5 states. At some moment the particle (ball) is in one of the states S i. For each step, the particle can only go to the neighboring state: in S i-1 with probability p, V S i+1 with probability q. At the same time (as is known) p +q=1. If a particle reaches the end state, it remains there forever. The probabilities are fixed. In states S i, i=2,3,4 the particle cannot remain.

Let's build a matrix P, which describes the probabilities of a particle transitioning from the state S i in a state S j.

This model shows that the process will end sooner or later. Thus this model represents a finite Markov chain. When modeling the final processes, it is of interest to calculate the probabilities of the end of the process in a particular node, as well as the average duration of the process.

Example 4. Model 7 “University education”

The process of studying at a university is 4 years of study (bachelor's degree). Let us highlight the following states



Did you like the article? Share with your friends!