Sample Mean Simulations

<< FitARMA.m

par = {-0.9, -0.5, 0.0, 0.5, 0.9}; NSIM = 10; 
    zbar = zmle = Array[0 &, NSIM]; eff = {};

i = 1; j = 2; iSim = 1;

Needs["Statistics`NormalDistribution`"]

par = {-0.9, -0.5, 0.0, 0.5, 0.9}; NSIM = 10; 
    zbar = zmle = Array[0 &, NSIM]; eff = {}; 
    SeedRandom[2341234747];

Do[
Do[
z = 
            If[i ≠ 
                j, 
SimulateGaussianARMA[{par[[i]]}, {par[[
                    j]]}, 
                100], 
RandomArray[
                NormalDistribution[0, 1], 
                100]]; 
zbar[[
              iS]] = 
            Mean[z]; 
zmle[[
              iS]] = 
            Mu /. Rest[GetARMAMeanFit[1, 1, 30, z]];
, {iS, 
            NSIM}]; 
eff = {eff, 
            Mean[zmle^2]/Mean[zbar^2]};, 
{i, 
          Length[par]}, {j, Length[par]}] // Timing

\(\(co = {\*""(Subscript[θ, 1])=-0.9"", \*""(Subscript[θ, 1])=-0.5"", \*""(Subscript[θ, 1])=0"", \*""(Subscript[θ, 1])=0.5"", \*""(Subscript[θ, 1])=0.9""};\)\)

\(\(ro = {\*""(Subscript[ϕ, 1])=-0.9"", \*""(Subscript[ϕ, 1])=-0.5"", \*""(Subscript[ϕ, 1])=0"", \*""(Subscript[ϕ, 1])=0.5"", \*""(Subscript[ϕ, 1])=0.9""};\)\)

eff = 
        Partition[Flatten[eff], Length[par]];
TableForm[eff, TableHeadings -> {ro, co}]