bw_mod: Between Modulus Calculation

View source: R/CI_const_RD.R

bw_modR Documentation

Between Modulus Calculation

Description

Calculates the between moduli b_{jt} and b_{jc} for a given value of δ and C_j.

Usage

bw_mod(delta, Cj, Cbar, Xt, Xc, mon_ind, sigma_t, sigma_c)

Arguments

delta

a nonnegative value of δ.

Cj

the smoothness parameter aiming to adapt to.

Cbar

the largest smoothness parameter.

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).

Value

a list of two values, h_jt and h_jc.

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]
bw_mod(1, 1/2, 1, Xt, Xc, mon_ind, sigma_t, sigma_c)
bw_mod(1, 1/2, Inf, Xt, Xc, mon_ind, sigma_t, sigma_c)

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