bound_delta: This function computes what corresponds to the function...

View source: R/bound_delta.R

bound_deltaR Documentation

This function computes what corresponds to the function under(over)lined delta in Section 3.2.2 in DDL, that is, estimates the sharp bounds on the AME for each individual observation, using parallel computing. It can also be used to compute the sharp bounds on the ATE, accounting for the Y(2X - 1) term

Description

This function computes what corresponds to the function under(over)lined delta in Section 3.2.2 in DDL, that is, estimates the sharp bounds on the AME for each individual observation, using parallel computing. It can also be used to compute the sharp bounds on the ATE, accounting for the Y(2X - 1) term

Usage

bound_delta(
  data,
  estimators,
  other_numbers,
  Vt,
  coeffsOmega,
  topCoeffOmega,
  nbCores,
  firstTermATE = NULL
)

Arguments

data

is an environment variable containing the relevant data, formatted by format_data (see function documentation). In particular, it contains: - data$Y a matrix of size n x Tmax containing the values of the dependent variable Y. - data$X an array of size n x Tmax x dimX containing the values of the covariates X.

estimators

is an environment variable containing some estimates from the data. It contains: - estimators$beta_hat, a list which contains the results from CMLE estimation: - estimators$beta_hat$beta_hat a vector of length dimX, the estimated value for the slope parameter. - estimators_beta_hat$phi_b a matrix of size n x dimX containing the value of the influence function at each observation (rows) w.r.t. each dimension of the covariates (columns). - estimators$beta_hat$var_b the estimated asymptotic covariance matrix, of size dimX x dimX, for the estimator beta_hat. - estimators$h_local_lin_proba a vector of length (Tmax + 1) containing, in j-th position, the bandwidth used to estimate the P(S = j - 1 | X)'s. - estimators$condlProbas: a matrix of size n x (Tmax + 1) containing, in position (i, j), the estimate for P(S = j - 1 | X) at the i-th observation. - estimators$densityEstimate a matrix of size n x (Tmax + 1) containing, at each row (individual), the estimated density for having covariates (X_1, ..., X_T). Each column represents the value found using the corresponding bandwidths from h.

other_numbers

is an environment variable containing the variable other_numbers$comb_numbers, a matrix of size (Tmax + 1) x (Tmax + 1) containg in position (i, j) the number (i choose j). If j > i the value is NA.

Vt

a vector of length n containing, for each individual, the value of v(X, beta). If computing the AME, v(X, beta) = X_t'beta where t is the period at which the AME is being computed. If computing the ATE, v(X, beta) is as above but the value of X_tk (where k is the variable relative to which we compute the ATE) must be switched (replaced by 1 if 0, and by 1 if 0).

coeffsOmega

a matrix of size n x (Tmax + 2) where each row represents the coefficient of the polynomial Omega(., x, beta). Coefficients start with the constant coefficient and there are (Tobsd[i] + 2) coefficients on each row where Tobsd[i] is the number of periods observed for the relevant individuals. Subsequent entries on the rows are 0s.

topCoeffOmega

a vector of length n containing the top coefficient for the original Omega polynomial for each individual.

nbCores

the number of cores to be used for parallel computing.

firstTermATE

(default NULL) if computing the ATE, a reminder of the vector of length n declaring for each individual the value of Y * (2X - 1) at the period at which the ATE is computed. If NULL, nothing is added, which corresponds to what is needed for the AME.

Value

returns a list containing: - average_bounds_on_delta a vector of length 2 containing the average of the estimated sharp lower and upper bounds on the AME. - indl_bounds_on_delta a matrix of size n x 2 containing, on each row, the estimated sharp lower and upper bounds on the AME for the relevant individual. - c_mat a matrix of size n x (Tmax + 1) containing, on each row, in the j_th column the estimated value of c_(j-1)(X) for the relevant individual. When j - 1 is larger than the number of observed period, the value is NA.


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