Interesting problem to code in Fortran - for non-stationary process
ConsiderX1,X2i.i.d. withP(Xi=1)=P(Xi=0)=0.5. Now defineX3=X1+X2(mod 2)
Notice thatX3is independent fromX1and fromX2individually. However the three variablesX1,X2,X3are not jointly independent.
Now consider a sequenceX1,X2,X3,…such that each triplet(X3n+1,X3n+2,X3n+3)has the same distribution as(X1,X2,X3)and all these triplets are independent.
With this one has that allXnhave the same distribution asX1, so that the process is 1 stationary. Also, all pairsXi,Xjwithi≠jare independent and hence have the same distribution (this gives 2 stationarity). However the triplet(X2,X3,X4)has a different distribution from(X1,X2,X3)(in fact,X2,X3andX4are jointly independent).