da: Internal function for computing scores w/r to regression...

View source: R/RcppExports.R

daR Documentation

Internal function for computing scores w/r to regression coefficients

Description

This function, not intended for end-users, implements the following recursions needed in computing scores with respect to regression coefficients:

D a^{(1)}_{t+1} = D a^{(1)}_{t} + D a^{(2)}_{t} - k^{(1)}_t x_t - k^{(1)}_t D a^{(1)}_{t}

D a^{(2)}_{t+1} = a^{(2)}_{t} - k^{(2)}_t x_t - k^{(2)}_t Da^{(1)}_{t}

where a^{(1)}_{t}, a^{(2)}_{t} are the one-step-ahead Kalman filtered state variables, and k^{(1)}_{t}, k^{(2)}_{t} the respective Kalman gain elements. The symbol $D$ represent the partial derivative with respect to the regression coefficients and $x_t$ is the vector of regressors. All variables are passed by reference and, so, no output is needed.

Usage

da(k1, k2, X, A1, A2)

Arguments

k1

numeric vector of n elements with the Kalman gain sequence for the first state variable;

k2

numeric vector of n elements with the Kalman gain sequence for the second state variable;

X

numeric matrix of dimension n\times k with the regressors;

A1

numeric matrix of dimension n\times k that, after calling the function will contain the sequence of gradients D a^{(1)}_t; the first row must be of zero values;

A2

numeric matrix of dimension n\times k that, after calling the function will contain the sequence of gradients D a^{(2)}_t; the first row must be of zero values;

Value

It does not return anything as it writes on the A1 and A2 matrices passed as reference.


jumps documentation built on April 4, 2025, 2:22 a.m.