function [Qstar, pistar, param, kast, n, lawtype, lawtypeannotation] = param_HMM()
% Qstar  k*k - True hidden Markov chain transition matrix
% pistar k*1 - True invariant law of the hidden Markov chain (by default, invariant law of Qstar)
% param  k*. - Parameters for the true emission laws. param(i,:) = parameters for law number i
% kast       - True number of hidden states
% n          - Number of observations
% lawtype    - Cell of kast strings qualifying the emission laws. Possible values:
%              'beta': each emission law will be a beta law
%                      with specified pair of parameters.
%              'hist': each emission law will have a piecewise
%                      constant density. Parameter format:
%                      [inf1 sup1 val1 inf2 sup2 val2 ... ]
%                      infi and supi correspond to the extrema of
%                      the interval i. They must all be distinct
%                      and the integral of the function (defined
%                      by sum_i[(supi-infi)*vali] equal to 1.
%                      infi is considered outside the interval.

%% Chain length
n = 100000;

%% Emission laws - EXAMPLE 1: 2 states, beta densities.
% kast = 2;
% lawtype = {'beta', 'beta'};
% lawtypeannotation = 'beta';
% param=[2 5; 4 2];
% Qstar = [0.9 0.1;...
%          0.2 0.2];

%% Emission laws - EXAMPLE 2: 3 states, beta densities.
kast = 3;
lawtype = {'beta', 'beta', 'beta'};
lawtypeannotation = 'beta';
% param=[1.5 5; 6 6; 7 2];    % 3 distinct peaks.
% param=[2 5; 4 2; 1.7 1.7];  % Poorly separated.
param=[2 5; 4 2; 4 4];      % Moderately separated.
Qstar = [0.8 0.1 0.1;...
         0.2 0.7 0.1;...
         .07 .13 0.8];

%% Emission laws - EXAMPLE 3: 6 hidden states, the first 3 with beta densities, the last 3 with custom histogram densities.
% kast = 6;
% lawtype = {'beta', 'beta', 'beta', 'hist', 'hist', 'hist'};
% lawtypeannotation = '3beta3hist';
% param = [2    5    0       0    0     0       0    0 0;...
%          4    2    0       0    0     0       0    0 0;...
%          4    4    0       0    0     0       0    0 0;...
%          0    3/10 10/6    3/10 1     10/14   0    0 0;...
%          0    6/10 15/16   6/10 8/10  5/16    8/10 1 30/16;...
%          4/10 5/10 10/3    5/10 9/10  5/3     0    0 0];
% Qstar = [0.7   0.1   0.1  0.05 0.025 0.025;...
%          0.1   0.7   0.1  0.05 0.02  0.03 ;...
%          0.1   0.1   0.7  0.05 0.03  0.02 ;...
%          0.02  0.03  0.05 0.05 0.8   0.05 ;...
%          0.03  0.02  0.05 0.05 0.05  0.8  ;...
%          0.025 0.025 0.05 0.8  0.05  0.05 ];

%% stationary law
pistar = func_stationaryLaw(Qstar);
