1function [hatA,drift,tau,v]=MG1_Shifts(A,ShiftType)
2%
this function performs the shift operation
for the MG1
case
3% input: A = [A0 A1 A2 ... A_maxd]
4% includes: one, tau and dbl
7v=zeros(m,1); %
default value
if redundant
8tau=1; %
default value
if redundant
10sumA=A(:,maxd*m+1:end);
12% beta = (A_maxd)e + (A_maxd + A_maxd-1)e + ... + (Amaxd+...+A1)e
14 sumA=sumA+A(:,i*m+1:(i+1)*m);
15 beta=beta+sum(sumA,2);
21%
if drift < 1 : positive recurrent
22hatA=zeros(m,m*(maxd+1));
24 if (strcmp(ShiftType,
'tau')|strcmp(ShiftType,
'dbl')) % shift tau to infinity
25 [tau,uT]=MG1_Decay(A);
26 A(:,m+1:2*m)=A(:,m+1:2*m)-eye(m);
28 rowhatA=zeros(1,m*(maxd+1));
29 rowhatA(1,maxd*i:end)=uT*A(:,maxd*i:end);
31 rowhatA(1,i*m+1:(i+1)*m)=tau*rowhatA(1,(i+1)*m+1:(i+2)*m)+...
32 uT*A(:,i*m+1:(i+1)*m);
34 hatA=A-ones(m,1)*rowhatA;
36 if (strcmp(ShiftType,
'dbl')) % shift one to zero
38 % e
is also the right eigenvector of hatA(1)
39 % as the shift-tau does not influence G and Ge=e,
40 % implying that hatA(1)e = e as G=hatA(G)
42 if (strcmp(ShiftType,'one')) % shift one to zero
43 A(:,m+1:2*m)=A(:,m+1:2*m)-eye(m);
45 if (strcmp(ShiftType,'one')|strcmp(ShiftType,'dbl')) % shift one ot zero
46 colhatA=zeros(m,maxd+1);
47 colhatA(:,1)=sum(A(:,1:m),2); % colhatA(:,1) = (A0)e
49 colhatA(:,i+1)=colhatA(:,i)+sum(A(:,i*m+1:(i+1)*m),2);
50 % colhatA(:,i+1) = (A0+A1+...+Ai)e
52 hatA=A-kron(colhatA,ones(1,m)/m); % hatAi = Ai - (A0+A1+...+Ai)e*uT
55 if (strcmp(ShiftType,'one')|strcmp(ShiftType,'dbl')) % shift one to infinity
56 A(:,m+1:2*m)=A(:,m+1:2*m)-eye(m);
57 rowhatA=zeros(1,m*(maxd+1));
58 rowhatA(1,maxd*i:end)=theta*A(:,maxd*i:end);
60 rowhatA(1,i*m+1:(i+1)*m)=rowhatA(1,(i+1)*m+1:(i+2)*m)+...
61 theta*A(:,i*m+1:(i+1)*m); % rowhatAi = theta(Amaxd+...+Ai)
63 hatA=A-ones(m,1)*rowhatA;
65 if (strcmp(ShiftType,'dbl')) % shift one to infinity
67 A(:,m+1:2*m)=A(:,m+1:2*m)+eye(m);
68 % v
is also the right eigenvector of hatA(tau)
69 % as the shift-one does not influence G and Gv=tau*v,
70 % implying that hatA(tau)v = tau*v as G=hatA(G)
72 if (strcmp(ShiftType,'tau')|strcmp(ShiftType,'dbl')) % shift tau to zero
73 [tau,v]=GIM1_Caudal(A);
74 A(:,m+1:2*m)=A(:,m+1:2*m)-eye(m);
76 colhatA=zeros(m,maxd+1);
77 colhatA(:,1)=A(:,1:m)*v; % colhatA(:,1) = (A0)v
79 colhatA(:,i+1)=colhatA(:,i)*tau^(-1)+A(:,i*m+1:(i+1)*m)*v;
81 hatA=A-kron(colhatA,ones(1,m));
84hatA(:,m+1:2*m)=hatA(:,m+1:2*m)+eye(m);