OptEstimator: One-step estimator based on optimal sensitivity under lp...

Description Usage Arguments Value References Examples

View source: R/opt.R

Description

Computes the optimal sensitivity and the optimal estimator when the set \mathcal{C} takes the form c=B*gamma with the lp norm of gamma bounded by M.

Usage

1
2
3
4
5
6
7
8
9
OptEstimator(
  eo,
  B,
  M,
  p = 2,
  spath = NULL,
  alpha = 0.05,
  opt.criterion = "FLCI"
)

Arguments

eo

List containing initial estimates with the following components:

Sig

Estimate of variance of the moment condition, matrix with dimension d_g by d_g, where d_g is the number of moments

G

Estimate of derivative of the moment condition, matrix with dimension d_g by d_theta, where d_theta is the dimension of theta

H

Estimate of derivative of h(theta). A vector of length d_theta

n

sample size

h_init

Initial estimate of h(theta)

k_init

Initial sensitivity

g_init

Moment condition evaluated at initial estimate

B

matrix B with full rank and dimension d_g by d_gamma that determines the set \mathcal{C}, where d_gamma is the number of invalid moments, and d_g is the number of moments

M

Bound on the norm of gamma

p

Parameter determining which lp norm to use, must equal 1, 2, or Inf.

spath

Optionally, the solution path, output of lph to speed up computation. For p==1 and p==Inf only.

alpha

determines confidence level, 1-alpha, for constructing/optimizing confidence intervals.

opt.criterion

Optimality criterion for choosing optimal bias-variance tradeoff. The options are:

"MSE"

Minimize worst-case mean squared error of the estimator.

"FLCI"

Length of (fixed-length) two-sided confidence intervals.

"Valid"

Optimal estimator under valid moments. This returns the original estimator, with confidence intervals adjusted for possible misspecification

Value

Object of class "GMMEstimate", which is a list with at least the following components:

h

Point estimate

bias

Worst-case bias of estimator

se

Standard error of estimator

hl

Half-length of confidence interval, so that the confidence interval takes the form h +- hl

References

Armstrong, T. B., and M. Kolesár (2020): Sensitivity Analysis Using Approximate Moment Condition Models, https://arxiv.org/abs/1808.07387

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Replicates estimates in first line of Figure 1 in Armstrong and Kolesár
## (2020)
## 1. Compute matrix B when all instruments are invalid
I <- vector(mode="logical", length=nrow(blp$G))
I[c(6:13, 20:31)] <- TRUE
B <- blp$ZZ %*% diag(sqrt(blp$n)*abs(blp$perturb)/blp$sdZ)[, I, drop=FALSE]
## 2. Collect initial estimates
blp$k_init <- -drop(blp$H %*% solve(crossprod(blp$G, blp$W %*% blp$G),
                                    crossprod(blp$G, blp$W)))
eo <- list(H=blp$H, G=blp$G, Sig=blp$Sig, n=blp$n, g_init=blp$g_init,
           k_init=blp$k_init, h_init= blp$h_init)
OptEstimator(eo, B, M=sqrt(sum(I)), p=2, alpha=0.05, opt.criterion="Valid")
OptEstimator(eo, B, M=sqrt(sum(I)), p=2, alpha=0.05, opt.criterion="FLCI")

kolesarm/GMMSensitivity documentation built on Sept. 17, 2020, 5:47 p.m.