Derivations IMA(1) Case

Before evaluating this notebook, evaluate code.nb

Purpose

To derive using the Pierce approximation the information matrix for the IA component for step, pulse and ramp interventions.  To provide a specialized Mathematica program for this.

Introduction

The general form of the simple step intervention model with ARIMA disturbances may be written,

\(TraditionalForm\`∇\^d z\_t = α + ω\_0\ ∇\^d ℑ\_t\%\((T)\)\  + \ \(\(θ(B)\)\/\(ϕ(B)\)\) 
          a\_t\)

where (Subscript[ℑ, t]^((T))) represents a step, pulse or ramp intervention denoted respectively by,

(Subscript[S, t]^((T)))={({{0, t < T}, {1, t ≥ T}})

(Subscript[P, t]^((T)))={({{0, t ≠  T}, {1, t = T}})

(Subscript[R, t]^((T)))={({{0, t < T}, {t - T + 1, t ≥ T}})

Then the Fisher information matrix for (α,  (Subscript[ω, 0])) is given by

(({{N (κ^2) , \(\(Σ\_t\) κ\ b\_t\)}, {(Subscript[Σ, t]) κ (Subscript[b, t]), \(\(Σ\_t\)\(\ \)\(b\_t\%2\)\(\ \)\)}}))

where κ = -ϕ(1)/θ(1) and (Subscript[b, t]) = -ϕ(B)/θ(
              B)  (Subscript[x, t]), where (Subscript[x, t]) = (∇^d) (Subscript[ℑ, t]^((T))),  
      N = n - d - (Subscript[d, s]) s

Ramp Case

InformationMatrixIAExact[25, 10, {}, {0.5}, 
      IAType -> "Ramp"]

InformationMatrixIAExact[25, 10, {}, {0.5}, IAType -> "Ramp", 
      Differencing -> 1]

InformationMatrixIAPierce[25, 10, {}, {0.5}, IAType -> "Ramp", 
      Differencing -> 1]

Step Case

InformationMatrixIAExact[25, 10, {}, {0.5}, 
      IAType -> "Step"]

InformationMatrixIAExact[25, 10, {}, {0.5}, IAType -> "Step", 
      Differencing -> 1]

InformationMatrixIAPierce[25, 10, {}, {0.5}, IAType -> "Step", 
      Differencing -> 1]

Pulse Case

InformationMatrixIAExact[25, 10, {}, {0.5}, 
      IAType -> "Pulse"]

InformationMatrixIAExact[25, 10, {}, {0.5}, IAType -> "Pulse", 
      Differencing -> 1]

InformationMatrixIAPierce[25, 10, {}, {0.5}, IAType -> "Pulse", 
      Differencing -> 1]

Step Intervention

InformationMatrixIMA1Step[n_, T_,  θ_] := 
      With[{κ = 1/(1 - θ), 
            b12 = (Plus @@ 
                    Table[(θ^k), {k, 0, 
                        n - T}])/(1 - θ)}, {{(n - 
                    1) (κ^2), b12}, {b12, 
              Plus @@ Table[(θ^(2 k)), {k, 0, 
                    n - T}]}}] /; θ ≠ 0

In general, for θ ≠ 0, \(TraditionalForm\`∑\+t b\_t = \(-\(∑\+\(k = 0\)\%\(n - T\)θ\^k\)\)\) and κ = -/(1 - θ) and \(TraditionalForm\`∑\+t b\_t\%2 = ∑\+\(k = 0\)\%\(n - T\)θ\^\(2\ k\)\)

(({{N/(((1 - θ))^2), \(\(\((1 - θ)\)\^\(-1\)\) \(∑\+\(k = 0\)\%\(n - T\)θ\^k\)\)}, {\(\(\((1 - θ)\)\^\(-1\)\) \(∑\+\(k = 0\)\%\(n - T\)θ\^k\)\), (∑_(k = 0)^(n - T))(θ^(2 k))}}))

where for θ = 0, we define (θ^0) = 1.

More convenient expression for sum,

Sum[(θ^k), {k, 0, n - T}] // Simplify

Sum[(θ^(2  k)), {k, 0, n - T}] // Simplify

(({{N/(((1 - θ))^2), \(\(\((1 - θ)\)\^\(-2\)\) \((1 - θ\^\(n + 1 - T\))\)\)}, {\(\(\((1 - θ)\)\^\(-2\)\) \((1 - θ\^\(n + 1 - T\))\)\), \(\(\((1 - θ\^2)\)\^\(-1\)\) \((1 - θ\^\(2 \((n + 1 - T)\)\))\)\)}}))

InformationMatrixIMA1Step[n_, 
        T_,  θ_] := 
Module[
{κ = 
              1/(1 - θ), 
b12 = ((1 - θ)^(-2))*(1 - θ^(n + 1 - 
                          T))
}, 
{
{(n - 1) (κ^2), 
              b12}, 
{b12, ((1 - θ^2)^(-1))*(1 - θ^(2 (n + 1 - 
                              T)))
}
}
] /; θ ≠ 0

Ramp Intervention

\(TraditionalForm\`κ = \(\(-\(\(/\)\(1\)\)\) \((1 - θ\_1)\) = 1/\((θ\_1 - 1)\)\)\)

\(TraditionalForm\`b\_t = \(-\ \((1/\((1 - θ\_1\ B)\))\)\)\ R\_t\%\((T)\)\)

Ramp[n_?IntegerQ, T_?IntegerQ] := 
      Join[Array[0 &, T - 1], Range[n - T + 1]]

TSDifference[Ramp[20, 10], 1]

Step 1.  (∑_t) (Subscript[b, t])

κ = 1/(θ - 1);

b = 
      TSDifference[
          ICalc[25, 10, {-1}, {θ}, IAType -> "Ramp"]] // 
        FullSimplify

Plus @@ b // Simplify

κ*Plus @@ b  % /. θ -> 0.5

\(TraditionalForm\`κ\ \(∑\+t b\_t\) = ∑\+\(i = 0\)\%\(n - T\)\((n - T + 1 - i)\) θ\^i/\((1 - θ)\)\)

sumb[n_, T_, θ_] := 
      1/(1 - θ)*(n - T + 1 + 
            Sum[(n - T + 1 - i)*(θ^i), {i, 1, n - T}])

1/(1 - θ)*(n - T + 1 + 
            Sum[(n - T + 1 - i)*(θ^i), {i, 1, n - T}]) // 
      FullSimplify

(1/(1 - θ)*(n - T + 1 + 
              Sum[(n - T + 1 - i)*(θ^i), {i, 1, 
                  n - T}])) /. {n -> 25, 
        T -> 10, θ -> 0.5}

sumbSimple[n_, 
        T_, θ_] := (((1 - θ))^(-3))*(n + 1 - 
            T + (θ^(n + 2 - T)) - (n + 2 - 
                  T) θ)

TeXForm[(((1 - θ))^(-3))*(n + 1 - 
            T + (θ^(n + 2 - T)) - (n + 2 - 
                  T) θ)]

sumb[25, 10, 0.5]

sumbSimple[25, 10, 0.5]

sumb[25, 10, θ]

InformationMatrixIAPierce[25, 10, {}, {θ}, IAType -> "Ramp", 
        Differencing -> 1] // Simplify

Step 2.  (∑_t) (Subscript[b, t]^2)

bsq = 
      TSDifference[
            ICalc[25, 10, {-1}, {θ}, IAType -> "Ramp"]]^2 // 
        Simplify

Plus @@ bsq /. {θ -> 0.5}

Unfortunately it doesn't seem to simplify much.  So the best we can do is to note that the k-th nonzero entry is

(Sum[(t^k), {k, 0, k}])

\(TraditionalForm\`\((\((1 - θ\^\(k + 1\))\)/\((1 - θ)\))\)\^2, \ k = 0, 1,  ... \)

So we obtain,

\(TraditionalForm\`∑\+t b\_t\%2 = ∑\+\(k = 0\)\%\(n - T + 1\)\((\((1 - θ\^\(k + 1\))\)/\((1 - θ)\))\)\^2\)

sumbsq[n_, T_, θ_] := 
      Sum[((((1 - (θ^(k + 1)))/(1 - θ)))^2), {k, 0, 
          n - T}]

sumbsq[25, 10, 0.5]

Sum[((((1 - (θ^(k + 1)))/(1 - θ)))^2), {k, 0, 
          n - T}] // Simplify

d = Numerator[%]

d2 = FullSimplify[-d]

Part[d2, 2]

Part[d2, 2] + Part[d2, 1] + Part[d2, 3]

TeXForm[d2] >> e:/p/2003/tex/technometrics/i22.tex

Extra details to Step 2.

Plus @@ bsq // Simplify

Plus @@ bsq // FullSimplify

Final function

InformationMatrixIMA1Ramp[n_, 
        T_,  θ_] := 
With[
{κ = 
            1/(θ - 
                  1), 
b12 = (((1 - θ))^(-3))*(n + 1 - 
                  T + (θ^(n + 2 - T)) - (n + 2 - 
                        T) θ), 
b22 = (((θ^(-2 T)) ((θ^(4 + 2 n)) + (-1 - n + T) (θ^(2 T)) - 2 (θ^(2 + n + T)) - 2 (θ^(3 + n + T)) + 2 (θ^(1 + 2 T)) + (2 + n - T) (θ^(2 + 2 T))))/((((-1 + θ))^3) (1 + θ)))}, 
{{(n - 1) (κ^2), b12}, {b12, 
            b22}}
]

i = InformationMatrixIMA1Ramp[25, 10, 0.5]

Options[SEωIMA1] = {MeanZero -> False,  
          IAType -> "Step"};

\(SEωIMA1[n_, T_, θ_, \ 
        opts___?OptionQ] := 
Module[{}, 
mnQ = \(MeanZero /. {opts}\) /. 
            Options[SEωIMA1]; 
iaty = \(IAType /. {opts}\) /. Options[SEωIMA1]; 
i = 
          Which[
SameQ[iaty, "Step"], 
            InformationMatrixIMA1Step[n, 
              T, \ θ], 
SameQ[iaty, "Ramp"], 
            InformationMatrixIMA1Ramp[n, 
              T, \ θ]
]; 
i = 
          If[mnQ, {{i[[2, 2]]}}, 
            i]; 
\(Flatten[Inverse[i]] // Last\) // 
          Sqrt]\)

Pulse Intervention

\(TraditionalForm\`κ = \(\(-\(\(/\)\(1\)\)\) \((1 - θ\_1)\) = 1/\((θ\_1 - 1)\)\)\)

\(TraditionalForm\`b\_t = \(-\ \((1/\((1 - θ\_1\ B)\))\)\)\ P\_t\%\((T)\)\)

Step 1.  (∑_t) (Subscript[b, t])

κ = 1/(θ - 1);

b = 
      TSDifference[
          ICalc[25, 10, {-1}, {θ}, IAType -> "Pulse"]] // 
        FullSimplify

Plus @@ b // Simplify

κ*Plus @@ b  % /. θ -> 0.5

\(TraditionalForm\`κ\ \(∑\+t b\_t\) = θ\^\(n - T\)/\((1 - θ)\)\)

sumb[n_, 
        T_, θ_] := (θ^(n - T))/(1 - θ)

sumb[25, 10, 0.5]

InformationMatrixIAPierce[25, 10, {}, {θ}, 
        IAType -> "Pulse", Differencing -> 1] // Simplify

InformationMatrixIAPierce[25, 10, {}, {0.5}, IAType -> "Pulse", 
      Differencing -> 1]

Step 2.  (∑_t) (Subscript[b, t]^2)

bsq = 
      TSDifference[
            ICalc[25, 10, {-1}, {θ}, IAType -> "Pulse"]]^2 // 
        Simplify

Plus @@ bsq /. {θ -> 0.5}

Plus @@ bsq // Simplify

So we obtain,

\(TraditionalForm\`∑\+t b\_t\%2 = ∑\+\(k = 0\)\%\(2 \((n - T)\)\)2\ \((\(-θ\))\)\^k\)

sumbsq[n_, T_, θ_] := 
      Sum[2 (((-θ))^k), {k, 0, 2*(n - T)}]

sumbsq[25, 10, 0.5]

a = Sum[2 (((-θ))^k), {k, 0, 2*(n - T)}]

sumbsqSimple[n_, 
        T_, θ_] := (((1 + θ))^(-1))  2 (((-θ))^(-2 T)) ((((-θ))^(2 T)) + (((-θ))^(2 n)) θ)

sumbsqSimple[n_, T_, θ_] := 
      Sum[2 (((-θ))^k), {k, 0, 2*(n - T)}]

sumbsqSimple[n_, 
        T_, θ_] := (((1 + θ))^(-1))  2 (θ^(-2 T)) ((θ^(2 T)) + (θ^(2 n)) θ)

sumbsqSimple[n_, 
        T_, θ_] := (((1 + θ))^(-1))  2 (1 + (θ^(2 (n - T) + 1)) )

sumbsqSimple[25, 10, 0.5]

a = Numerator[a]

2 ((((-θ))^(2 T)) + (((-θ))^(2 n)) θ)

a /. {n -> 20, T -> 15, θ -> 0.8}

t2 = 2 ((θ^(2 T)) + (θ^(2  n + 1)))

t2 /. {n -> 20, T -> 15, θ -> 0.8}

t3 = 
      2 (θ^(2 T)) (1 + (θ^(2  n + 1 - 2 T)))

t3 /. {n -> 20, T -> 15, θ -> 0.8}

?FullSimplify

Final function for IMA Pulse

InformationMatrixIMA1Pulse[n_, 
        T_,  θ_] := 
With[{κ = 
            1/(θ - 
                  1), 
b12 = (θ^(n - T))/(1 - θ), 
b22 = (((1 + θ))^(-1))  2 (1 + (θ^(2 (n - T) + 1)) ) }, 
{{(n - 
                  1) (κ^2), b12}, {b12, 
            b22}}
]

Final Overall Function

InformationMatrixIMA1Step[n_, 
        T_,  θ_] := 
Module[
{κ = 
              1/(1 - θ), 
b12 = ((1 - θ)^(-2))*(1 - θ^(n + 1 - 
                          T))
}, 
{
{(n - 1) (κ^2), 
              b12}, 
{b12, ((1 - θ^2)^(-1))*(1 - θ^(2 (n + 1 - 
                              T)))
}
}
] /; θ ≠ 0

InformationMatrixIMA1Ramp[n_, 
        T_,  θ_] := 
With[
{κ = 
            1/(θ - 
                  1), 
b12 = (((1 - θ))^(-3))*(n + 1 - 
                  T + (θ^(n + 2 - T)) - (n + 2 - 
                        T) θ), 
b22 = (((θ^(-2 T)) ((θ^(4 + 2 n)) + (-1 - n + T) (θ^(2 T)) - 2 (θ^(2 + n + T)) - 2 (θ^(3 + n + T)) + 2 (θ^(1 + 2 T)) + (2 + n - T) (θ^(2 + 2 T))))/((((-1 + θ))^3) (1 + θ)))}, 
{{(n - 1) (κ^2), b12}, {b12, 
            b22}}
]

InformationMatrixIMA1Pulse[n_, 
        T_,  θ_] := 
With[{κ = 
            1/(θ - 
                  1), 
b12 = (θ^(n - T))/(1 - θ), 
b22 = (((1 + θ))^(-1))  2 (1 + (θ^(2 (n - T) + 1)) ) }, 
{{(n - 
                  1) (κ^2), b12}, {b12, 
            b22}}
]

Options[SEωIMA1] = {MeanZero -> False,  
          IAType -> "Step"};

\(SEωIMA1[n_, T_, θ_, \ 
        opts___?OptionQ] := 
Module[{mnQ, iaty, 
          i}, 
mnQ = \(MeanZero /. {opts}\) /. 
            Options[SEωIMA1]; 
iaty = \(IAType /. {opts}\) /. Options[SEωIMA1]; 
i = 
          Which[
SameQ[iaty, "Step"], 
            InformationMatrixIMA1Step[n, 
              T, \ θ], 
SameQ[iaty, "Ramp"], 
            InformationMatrixIMA1Ramp[n, 
              T, \ θ], 
SameQ[iaty, "Pulse"], 
            InformationMatrixIMA1Pulse[n, 
              T, \ θ]
]; 
i = 
          If[mnQ, {{i[[2, 2]]}}, 
            i]; 
\(Flatten[Inverse[i]] // Last\) // 
          Sqrt]\)

Backup

DeleteFile["d:/math/2003/PowerIA/work/DerivationsIMA1Case.m"];

AllFNS={SEωIMA1};

Save["d:/math/2003/PowerIA/work/DerivationsIMA1Case.m", 
        ALLFNS];

Testing

STEP INTERVENTIONS

Simple step intervention with n = 50,  T = 25

InformationMatrixIMA1Step[50, 25, 0.5]

InformationMatrixIA[50, 25, {}, {0.5}, 
      Differencing -> 1]

InformationMatrixIAPierce[50, 25, {}, {0.5}, 
      Differencing -> 1]

InformationMatrixIAExact[50, 25, {}, {0.5}, 
      Differencing -> 1]

SEOmega[50, 25, {}, {0.5}, Differencing -> 1]

SEωIMA1[50, 25, 0.5]

SEωIMA1[50, 25, 0.5, MeanZero -> True]

RAMP INTERVENTIONS

Simple ramp intervention for n = 20,  T = 10

SEOmega[20, 10, {}, {0.5}, IAType -> "Ramp", 
      Differencing -> 1]

SEωIMA1[20, 10, 0.5, IAType -> "Ramp"]

SEOmega[20, 10, {}, {0.5}, IAType -> "Ramp", 
      PierceApproximation -> False , Differencing -> 1]

SEOmega[20, 10, {}, {0.5}, IAType -> "Ramp", 
      PierceApproximation -> False , Differencing -> 1, 
      MeanZero -> True]

Table[
      SEωIMA1[n, 10, 0.5, IAType -> "Ramp"], {n, 25, 300, 
        25}]

Table[
      SEωIMA1[n, 10, 0.5, IAType -> "Ramp"], {n, 100, 10000, 
        500}]

Table[
      SEωIMA1[n, n/2, 0.5, IAType -> "Ramp"], {n, 100, 10000, 
        500}]

Limit[SEωIMA1[n, n/2, 0.5, IAType -> "Ramp"], 
      n -> ∞]

Table[
      SEOmega[n, 10, {}, {0.5}, IAType -> "Ramp", 
        Differencing -> 1], {n, 100, 10000, 500}]

Table[
      SEOmega[n, 10, {}, {0.5}, IAType -> "Ramp", 
        Differencing -> 1], {n, 100, 10000, 500}]

SEOmega[n, 10, {}, {0.5}, IAType -> "Ramp", 
      Differencing -> 1]

Pulse INTERVENTIONS

Simple ramp intervention for n = 20,  T = 10

SEOmega[20, 10, {}, {0.5}, IAType -> "Pulse", 
      Differencing -> 1]

SEωIMA1[20, 10, 0.5, IAType -> "Pulse"]

SEOmega[20, 10, {}, {0.5}, IAType -> "Pulse", 
      PierceApproximation -> False , Differencing -> 1]

SEOmega[20, 10, {}, {0.5}, IAType -> "Pulse", 
      PierceApproximation -> False , Differencing -> 1, 
      MeanZero -> True]