view mt_init.m @ 9:cc549aca4ea6

Added optional shuffling of Markov chain symbols.
author samer
date Mon, 20 Feb 2012 13:39:30 +0000
parents be936975f254
children 0e0f2805ef9c
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)
	Sys.sample_transmats = @(k)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 = mt_calibrate(Sys);
end