Home > wafo > markov > mctp2stat.m

# mctp2stat

## PURPOSE

Calculates the stationary distribution for a MCTP.

## SYNOPSIS

[ro_min,ro_max,QQ]=mctp2stat(Q)

## DESCRIPTION

``` MCTP2STAT  Calculates the stationary distribution for a MCTP.

CALL: [ro_min,ro_max] = mctp2stat(F);

ro_min = Stationary distribution of minima.         [1xn]
ro_max = Stationary distribution of maxima.         [1xn]

F      = Cell array of min-max and max-min
matrices matrices for MCTP.                {1x2}
F{1,1} = min-Max matrix                             [nxn]
F{1,2} = Max-min matrix                             [nxn]

Examples:
[G, Gh] = mktestmat([-1 1 32],[-0.2 0.2],0.15,1);
[ro_min,ro_max] = mctp2stat({G Gh});

## CROSS-REFERENCE INFORMATION

This function calls:
 mc2stat Calculates the stationary distribution for a Markov chain. error Display message and abort function.
This function is called by:
 mctp2reverse Calculates the time-reversed MCTP for a SMCTP. smctp2stat Stationary distributions for a switching MCTP. smctpsim Simulates a switching Markov chain of turning points, test_markov Quick test of the routines in module 'markov'

## SOURCE CODE

```001 function [ro_min,ro_max,QQ]=mctp2stat(Q)
002 %MCTP2STAT  Calculates the stationary distribution for a MCTP.
003 %
004 % CALL: [ro_min,ro_max] = mctp2stat(F);
005 %
006 % ro_min = Stationary distribution of minima.         [1xn]
007 % ro_max = Stationary distribution of maxima.         [1xn]
008 %
009 % F      = Cell array of min-max and max-min
010 %          matrices matrices for MCTP.                {1x2}
011 % F{1,1} = min-Max matrix                             [nxn]
012 % F{1,2} = Max-min matrix                             [nxn]
013 %
014 % Examples:
015 %    [G, Gh] = mktestmat([-1 1 32],[-0.2 0.2],0.15,1);
016 %    [ro_min,ro_max] = mctp2stat({G Gh});
017 %
019
020 % Tested  on Matlab  5.3
021 %
022 % History:
023 % Updated by PJ 18-May-2000
024 %   updated for WAFO
025 % Created by PJ (Pär Johannesson) 1999
026
027 % Check input arguments
028
029 ni = nargin;
030 no = nargout;
031 error(nargchk(1,1,ni));
032
033 if isempty(Q{1,2})
034   Q{1,2} = Q{1,1}';
035 end
036
037 % Stationary distribution (=ro) of local minima with transition matrix
038 % Qt = Q*Qh = "Transition matrix for min-to-min"
039
040 Qt = Q{1,1}*Q{1,2};
041 ro_min = mc2stat(Qt(1:end-1,1:end-1));  % Stationary distr., row vector
042 ro_min = [ro_min 0];  % Minimum can't reach the highest level
043
044 % Stationary distribution (=roh) of local maxima with transition matrix
045 % Qt = Qh*Q = "Transition matrix for max-to-max"
046
047 Qth = Q{1,2}*Q{1,1};
048 ro_max = mc2stat(Qth(2:end,2:end));  % Stationary distr., row vector
049 ro_max = [0 ro_max];  % Maximum can't reach the highest level
050```

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group

Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003