Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

deriv_2nd_ar1

Analytic second derivative matrix for AR(1) process


Description

Calculates the second derivative for the AR(1) process and places it into a matrix form. The matrix form in this case is for convenience of the calculation.

Usage

deriv_2nd_ar1(phi, sigma2, tau)

Arguments

phi

A double corresponding to the phi coefficient of an AR(1) process.

sigma2

A double corresponding to the error term of an AR(1) process.

tau

A vec containing the scales e.g. 2^tau

Value

A matrix with the first column containing the second partial derivative with respect to phi and the second column contains the second partial derivative with respect to sigma^2

Process Haar WV Second Derivative

Taking the second derivative with respect to phi yields:

d^2/dphi^2 nu[j]^2(phi, sigma2) = 2*sigma2*(4*(1 + 3*phi)*(1 + phi + phi^2)* (3 - 4*phi^(tau[j]/2) + phi^tau[j]) + (-1 + phi^2)* (3*(1 + phi)^2 + 2*phi^(tau[j]/2 - 1)*(1 + phi*(4 + 7*phi)) - phi^(tau[j] - 1)*(1 + phi*(4 + 7*phi)))* tau[j] + phi^(tau[j]/2 - 1)*(-1 + phi^2)^2*(-1 + phi^(tau[j]/2))*tau[j]^2)/((-1 + phi)^5*(1 + phi)^3*tau[j]^2)

Taking the second derivative with respect to sigma^2 yields:

d^2/dsigma2^2 nu[j]^2(phi, sigma2) = 0

Taking the derivative with respect to phi and sigma2 yields:

d/dsigma * d/dphi nu[j]^2(phi, sigma2) = (2*((-(3 - 4*phi^(tau[j]/2) + phi^tau[j]))*(1 + phi*(2 + 3*phi)) + (-1 + phi^2)*(-1 - phi - 2*phi^(tau[j]/2) + phi^tau[j])*tau[j]))/((-1 + phi)^4*(1 + phi)^2*tau[j]^2)

Author(s)

James Joseph Balamuta (JJB)


simts

Time Series Analysis Tools

v0.1.1
AGPL-3 | file LICENSE
Authors
Stéphane Guerrier [aut, cre, cph], James Balamuta [aut, cph], Roberto Molinari [aut, cph], Justin Lee [aut], Yuming Zhang [aut], Wenchao Yang [ctb], Nathanael Claussen [ctb], Yunxiang Zhang [ctb], Christian Gunning [cph], Romain Francois [cph], Ross Ihaka [cph], R Core Team [cph]
Initial release
2019-07-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.