<< Chapter < Page | Chapter >> Page > |
The procedure arrival assumes the setup provided by chainset, including a set E of target states. The procedure prompts for the number r of repetitions and the initial state. Then it produces r succesive trajectories, each starting with the prescribed initial state and ending on one of the target states. The arrivaltimes vary from one run to the next. Various statistics are computed and displayed or made available. In the single-run case ( ), the trajectory may be displayed. An auxiliary procedure plotdbn may be used in the multirun case to plot the distribution of arrival times.
rand('seed',0)
arrival % Assumes chainset has been run, as aboveEnter the number of repetitions 1 % Single run case
The target state set is:16 22 25
Enter the initial state 34 % Specified initial stateThe arrival time is 6 % Data on trajectory
The state reached is 16To view the trajectory of states, call for TR
disp(TR') % Optional call to view trajectory0 1 2 3 4 5 6
34 13 10 28 34 37 16rand('seed',0)
arrivalEnter the number of repetitions 1000 % Call for 1000 repetitions
The target state set is:16 22 25
Enter the initial state 34 % Specified initial stateThe result of 1000 repetitions is: % Run data (see optional calls below)
Term state Rel Freq Av time16.0000 0.3310 3.3021
22.0000 0.3840 3.244825.0000 0.2850 4.3895
The average arrival time is 3.59The standard deviation is 3.207
The minimum arrival time is 1The maximum arrival time is 23
To view the distribution of arrival times, call for dbnTo plot the arrival time distribution, call for plotdbn
plotdbn % See
[link]
It would be difficult to establish analytically estimates of arrival times. The simulation procedure gives a reasonable “feel” for these times and how they vary.
The procedure recurrence is similar to the procedure arrival. If the initial state is not in the target set, it behaves as does the procedure arrival and stops on the firstvisit to the target set. However, if the initial state is in the target set, the procedures are different. The procedure arrival stops with zero transitions, sinceit senses that it has “arrived.” We are usually interested in having at least one transition– back to the same state or to another state in the target set.We call these times recurrence times .
rand('seed',0)
recurrenceEnter the number of repititions 1
The target state set is:16 22 25
Enter the initial state 22
The recurrence time is 1
The state reached is 16To view the trajectory of state numbers, call for TR
disp(TR') 0 122 16
recurrenceEnter the number of repititions 1000
The target state set is:16 22 25
Enter the initial state 25The result of 1000 repetitions is:
Term state Rel Freq Av time16.0000 0.3680 2.8723
22.0000 0.2120 4.674525.0000 0.4200 3.1690
The average recurrence time is 3.379The standard deviation is 3.0902
The minimum recurrence time is 1The maximum recurrence time is 20
To view the distribution of recurrence times, call for dbnTo plot the recurrence time distribution, call for plotdbn
% See
[link]
The procedure kvis stops when a designated number k of states are visited. If k is greater than the number of target states, or if no k is designated, the procedure stops when all have been visited. For , the behavior is the same as arrival. However, that case is better handled by the procedure arrival, which provides more statistics on the results.
rand('seed',0)
kvis % Assumes chainset has been runEnter the number of repetitions 1
The target state set is:16 22 25
Enter the number of target states to visit 2Enter the initial state 34
The time for completion is 7To view the trajectory of states, call for TR
disp(TR')0 1 2 3 4 5 6 7
34 13 10 28 34 37 16 25rand('seed',0)
kvisEnter the number of repetitions 100
The target state set is:16 22 25
Enter the number of target states to visit % Default-- visit all threeEnter the initial state 31
The average completion time is 17.57The standard deviation is 8.783
The minimum completion time is 5The maximum completion time is 42
To view a detailed count, call for D.The first column shows the various completion times;
the second column shows the numbers of trials yielding those times
The first goal of this somewhat sketchy introduction to Markov processes is to provide a general setting which gives insight into the essential character and structure of such systems.The important case of homogenous chains is introduced in such a way that their algebraic structure appears as a logical consequence of the Markov propertiy. The general theoryis used to obtain some tools for formulating homogeneous chains in practical cases. Some MATLAB tools for studying their behavior are applied to anartificial example, which demonstrates their general usefulness in studying many practical, applied problems.
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?