cov_mat_calc: Covariance Matrix Calculation for Multiple Estimators

View source: R/CI_intsec_RD.R

cov_mat_calcR Documentation

Covariance Matrix Calculation for Multiple Estimators

Description

Calculates the covariance matrix of J estimators, Lhat_1(δ),..., Lhat_J(δ).

Usage

cov_mat_calc(delta, Cvec, Cbar, Xt, Xc, mon_ind, sigma_t, sigma_c, bmat)

Arguments

delta

a nonegative scalar value; it can be left unspecified if bmat is specified.

Cvec

a sequence of smoothness parameters

Cbar

the Lipschitz coefficient for the largest function space we consider

Xt

n_t by k design matrix for the treated units.

Xc

n_c by k design matrix for the control units.

mon_ind

index number for monotone variables.

sigma_t

standard deviation of the error term for the treated units (either length 1 or n_t).

sigma_c

standard deviation of the error term for the control units (either length 1 or n_c).

bmat

a J by 2 matrix of modulus values; it can be left unspecified if delta is specified.

Details

This constructs a covariance matrix corresponding to expressions (17) and (18) of our paper.

Value

a J by J covariance matrix.

Examples

n <- 500
d <- 2
X <- matrix(rnorm(n * d), nrow = n, ncol = d)
tind <- X[, 1] < 0 & X[, 2] < 0
Xt <- X[tind == 1, ,drop = FALSE]
Xc <- X[tind == 0, ,drop = FALSE]
mon_ind <- c(1, 2)
sigma <- rnorm(n)^2 + 1
sigma_t <- sigma[tind == 1]
sigma_c <- sigma[tind == 0]
cov_mat_calc(1, (1:5)/5, 1, Xt, Xc, mon_ind, sigma_t, sigma_c)
cov_mat_calc(1, (1:5)/5, Inf, Xt, Xc, mon_ind, sigma_t, sigma_c)

koohyun-kwon/rdadapt documentation built on May 8, 2022, 8:49 p.m.