1% [D0, D1] = DMAP2FromMoments(moms, corr1)
3% Returns a discrete MAP(2) which has the same 3 marginal
4% moments and lag-1 autocorrelation as given.
8% moms : vector, length(3)
9% First three marginal moments of the inter-arrival times
11% The lag-1 autocorrelation of the inter-arrival times
15% D0 : matrix, shape (2,2)
16% The D0 matrix of the discrete MAP(2)
17% D1 : matrix, shape (2,2)
18% The D1 matrix of the discrete MAP(2)
22% Raises an exception if the moments are not feasible with
23% a DMAP(2). This procedure calls :func:`butools.dmap.DRAPFromMoments`
24% followed by :func:`butools.dmap.CanonicalFromDMAP2`.
27function [D0, D1] = DMAP2FromMoments (moms, corr1)
29 Nm = [1, moms(1); moms(1), corr1*(moms(2)-moms(1)^2)+moms(1)^2];
30 [H0, H1] = DRAPFromMoments (moms, Nm);
32 global BuToolsCheckInput;
34 if isempty(BuToolsCheckInput)
35 BuToolsCheckInput = true;
38 oldCheckInput = BuToolsCheckInput;
39 BuToolsCheckInput = false;
41 [D0, D1] = CanonicalFromDMAP2 (H0, H1);
43 BuToolsCheckInput = oldCheckInput;