view mt_init.m @ 11:0e0f2805ef9c

Added new mechanism for checking Markov chains for uniqueness of stationary distribution; new supporting files and new parameters to mt_init (see CHANGES). Some functions require greater Matlab library, not included.
author samer
date Sun, 26 Feb 2012 23:11:10 +0000
parents cc549aca4ea6
children
line wrap: on
line source
% mt_init - Initialise Melody Triangle system.
%
% mt_init :: 
%    A0:nonneg  ~'parameter for sampling',
%    B0:nonneg  ~'parameter for sampling',
%    A1:nonneg  ~'parameter for sampling',
%    B0:nonneg  ~'parameter for sampling',
%    L:natural  ~'number of transmats to sample',
%    Shuffle:book ~'whether or not to shuffle symbols when returning transmat'
% -> mt_system.
%
% Initial system contains no transition matrices - you
% must call mt_ensure with a particular value of K
% to sample a set of L transition matrices of that size.
%
% Initial calibration is equivalent to:
%    sys=mt_calibrate(sys, 1:3, [0,1,0;0,0,1]);
%
% The figure for scatter plots is fixed to figure 50 for now.

function Sys=mt_init(A0,B0,A1,B1,L,Shuffle,ErgMethod,Tol)
	if nargin<7, ErgMethod=1; end
	if nargin<6, Shuffle=0; end
	if nargin<8, Tol=0.001; end
	Sys.sample_transmats = @(k,l)sample_transmat_hdp(A0,B0,A1,B1,k,l);
	Sys.transmats = {};
	Sys.info      = {};
	Sys.refpoints = [0,0;1,0;0,1]';
	Sys.fig       = 50;
	Sys.shuffle   = Shuffle;
	Sys.ergmeth   = ErgMethod;
	Sys.L         = L;
	Sys.tol       = Tol;
	Sys = mt_calibrate(Sys);
end