1% [G0, G1] = CanonicalFromMAP2(D0, D1, prec)
3% Returns the canonical form of an order-2 Markovian
8% D0 : matrix, shape (2,2)
9% The D0 matrix of the MAP(2)
10% D1 : matrix, shape (2,2)
11% The D1 matrix of the MAP(2)
12% prec : double, optional
13% Numerical precision to check the input,
default
18% G0 : matrix, shape (1,2)
19% The D0 matrix of the canonical MAP(2)
20% G1 : matrix, shape (2,2)
21% The D1 matrix of the canonical MAP(2)
25% This procedure calculates 3 marginal moments and the lag-1
26% autocorrelation of the input and calls
'MAP2FromMoments'.
28function [G0, G1] = CanonicalFromMAP2 (D0, D1)
30 global BuToolsCheckInput;
31 if isempty(BuToolsCheckInput)
32 BuToolsCheckInput =
true;
37 error(
'CanonicalFromMAP2: size is not 2!');
39 if ~CheckMAPRepresentation(D0, D1)
40 error(
'CanonicalFromMAP2: Input isn''t a valid MAP representation!');
44 moms = MarginalMomentsFromMAP (D0, D1, 3);
45 corr1 = LagCorrelationsFromMAP (D0, D1, 1);
46 [G0, G1] = MAP2FromMoments (moms, corr1);