build_hankel_matrices: This function returns the upper and lower Hankel matrices...

View source: R/build_hankel_matrices.R

build_hankel_matricesR Documentation

This function returns the upper and lower Hankel matrices given a moment vector. See DDL paper section 3.2.2. The NAs at the tail of the moment vector are ignored.

Description

The function may also return the derivatives of the matrices with respect to each moment.

Usage

build_hankel_matrices(m, differentiating = FALSE, add_zeroeth_moment = TRUE)

Arguments

m

a moment vector with tail in NAs, which should be ignored. Starts at the moment of order 1, unless add_zeroeth_moment is FALSE.

differentiating

(default FALSE) if TRUE, the added zeroeth moment is 0. The input moment should then be only 0's, but for the coordinate w.r.t. which we want to differentiate, which should be one (by linearity).

add_zeroeth_moment

(default TRUE) if FALSE, the zeroeth moment (1) is added at the start of the input moment vector.

Value

A list with two elements, upperHankel and lowerHankel, corresponding to the upper bar and lower bar H matrices in the DDL paper (see section 3.2.2), respectively. If differentiating is TRUE and m is as specified above, the output is also the derivative of the Hankel matrices w.r.t. the relevant coordinate, by linearity.


cgaillac/MarginalFElogit documentation built on Dec. 24, 2024, 3:23 p.m.