View source: R/compute-AEL-functions.R
compute_AEL | R Documentation |
Evaluates the Log-Adjusted Empirical Likelihood (AEL) (Chen, Variyath, and Abraham 2008) for a given data set, moment conditions and parameter values. The AEL function is formulated as
\log \text{AEL}(\boldsymbol{\theta}) = \max_{\mathbf{w}'} \sum\limits_{i=1}^{n+1} \log(w_i'),
where \mathbf{z}_{n+1}
is a pseudo-observation that satisfies
h(\mathbf{z}_{n+1}, \boldsymbol{\theta}) = -\frac{a_n}{n} \sum\limits_{i=1}^n h(\mathbf{z}_i, \boldsymbol{\theta})
for some constant a_n > 0
that may (but not necessarily) depend on n
, and \mathbf{w}' = (w_1', \ldots, w_n', w_{n+1}')
is a vector of probability weights that define a discrete distribution on \{\mathbf{z}_1, \ldots, \mathbf{z}_n, \mathbf{z}_{n+1}\}
, and are subject to the constraints
\sum\limits_{i=1}^{n+1} w_i' h(\mathbf{z}_i, \boldsymbol{\theta}) = 0, \quad \text{and} \quad \sum\limits_{i=1}^{n+1} w_i' = 1.
Here, the maximizer \tilde{\mathbf{w}}
is of the form
\tilde{w}_i = \frac{1}{n+1} \frac{1}{1 + \lambda_{\text{AEL}}^\top h(\mathbf{z}_i, \boldsymbol{\theta})},
where \lambda_{\text{AEL}}
satisfies the constraints
\frac{1}{n+1} \sum\limits_{i=1}^{n+1} \frac{h(\mathbf{z}_i, \boldsymbol{\theta})}{1 + \lambda_{\text{AEL}}^\top h(\mathbf{z}_i, \boldsymbol{\theta})} = 0, \quad \text{and} \quad
\frac{1}{n+1} \sum\limits_{i=1}^{n+1} \frac{1}{1 + \lambda_{\text{AEL}}^\top h(\mathbf{z}_i, \boldsymbol{\theta})} = 1.
compute_AEL(th, h, lam0, a, z, iters = 500, returnH = FALSE)
th |
p x 1 parameter vector to evaluate the AEL function at |
h |
User-defined moment-condition function. Note that output should be an (n-1) x K matrix where K is necessarily |
lam0 |
Initial vector for Lagrange multiplier lambda |
a |
Positive scalar adjustment constant |
z |
(n-1) x d data matrix. Note that |
iters |
Number of iterations using Newton-Raphson for estimation of lambda. Default: |
returnH |
Whether to return calculated values of h, H matrix and lambda. Default: 'FALSE |
Note that theta (th
) is a p-dimensional vector, h
is a K-dimensional vector and K \geq
p
A numeric value for the Adjusted Empirical Likelihood function computed evaluated at a given theta value
Weichang Yu, Jeremy Lim
Chen, J., Variyath, A. M., and Abraham, B. (2008), “Adjusted Empirical Likelihood and its Properties,” Journal of Computational and Graphical Statistics, 17, 426–443. Pages 2,3,4,5,6,7 \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.1198/106186008X321068")}
# Generating 30 data points from a simple linear-regression model
set.seed(1)
x <- runif(30, min = -5, max = 5)
vari <- rnorm(30, mean = 0, sd = 1)
y <- 0.75 - x + vari
z <- cbind(x, y)
lam0 <- matrix(c(0,0), nrow = 2)
th <- matrix(c(0.8277, -1.0050), nrow = 2)
# Specify AEL constant and Newton-Rhapson iteration
a <- 0.00001
iters <- 10
# Specify moment condition functions for linear regression
h <- function(z, th) {
xi <- z[1]
yi <- z[2]
h_zith <- c(yi - th[1] - th[2] * xi, xi*(yi - th[1] - th[2] * xi))
matrix(h_zith, nrow = 2)
}
result <- compute_AEL(th, h, lam0, a, z, iters)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.