Obtain the first derivative of the AR(1) process.
deriv_ar1(phi, sigma2, tau)
A matrix
with the first column containing the partial derivative with respect to \(\phi\)
and the second column contains the partial derivative with respect to \(\sigma ^2\)
A double
corresponding to the phi coefficient of an AR(1) process.
A double
corresponding to the error term of an AR(1) process.
A vec
containing the scales e.g. \(2^{\tau}\)
Taking the derivative with respect to \(\phi\) yields: $$\frac{\partial }{{\partial \phi }}\nu _j^2\left( {\phi ,{\sigma ^2}} \right) = \frac{{2{\sigma ^2}\left( {\left( {{\phi ^2} - 1} \right){\tau _j}\left( { - 2{\phi ^{\frac{{{\tau _j}}}{2}}} + {\phi ^{{\tau _j}}} - \phi - 1} \right) - \left( {\phi \left( {3\phi + 2} \right) + 1} \right)\left( { - 4{\phi ^{\frac{{{\tau _j}}}{2}}} + {\phi ^{{\tau _j}}} + 3} \right)} \right)}}{{{{\left( {\phi - 1} \right)}^4}{{\left( {\phi + 1} \right)}^2}\tau _j^2}}$$
Taking the derivative with respect to \(\sigma ^2\) yields: $$\frac{\partial }{{\partial {\sigma ^2}}}\nu _j^2\left( {\phi ,{\sigma ^2}} \right) = \frac{{\left( {{\phi ^2} - 1} \right){\tau _j} + 2\phi \left( { - 4{\phi ^{\frac{{{\tau _j}}}{2}}} + {\phi ^{{\tau _j}}} + 3} \right)}}{{{{\left( {\phi - 1} \right)}^3}\left( {\phi + 1} \right)\tau _j^2}}$$
James Joseph Balamuta (JJB)