Zij: Calculate element Z_i,j

View source: R/util.R

ZijR Documentation

Calculate element ⁠Z_i,j⁠

Description

There are many special cases for calculating the ⁠i,j⁠th term in Z. These special cases must be handled on a term-by term basis. This function handles all those cases. See Z_byname() for details. The X matrices must be same size, must have same row and column names, and must have same row and column types. Note that i and j must be positive and less than or equal to nrow(X) and ncol(X), respectively.

Usage

Zij(
  i = NULL,
  j = NULL,
  X_0 = NULL,
  X_T = NULL,
  v_0i1 = matsbyname::rowprods_byname(X_0)[i, 1],
  v_Ti1 = matsbyname::rowprods_byname(X_T)[i, 1],
  X_0ij = X_0[i, j],
  X_Tij = X_T[i, j]
)

Arguments

i

optional row index for X_0 and X_T.

j

optional column index for X_0 and X_T.

X_0

optional sub-sector by factor matrix for time 0.

X_T

optional sub-sector by factor matrix for time T.

v_0i1

the i,1th element of the v_0 column vector. (v_0 is formed from the row products of the X_0 matrix.)

v_Ti1

the i,1th element of the v_T column vector. (v_T is formed from the row products of the X_T matrix.)

X_0ij

the i,jth element of the X_0 matrix

X_Tij

the i,jth element of the X_T matrix

Details

Arguments i, j, X_0, and X_T are optional. If they are not specified, arguments v_0i1, v_Ti1, X_0ij, and X_Tij must be given.

Value

the Z value corresponding to the v_0i1, v_Ti1, X_0ij, and X_Tij values


MatthewHeun/LMDIR documentation built on Jan. 13, 2024, 4:10 a.m.