ci_connorm | R Documentation |
Confidence intervals on normal mean, subject to linear constraints.
ci_connorm( y, A, b, eta, Sigma = NULL, p = c(level/2, 1 - (level/2)), level = 0.05, Sigma_eta = Sigma %*% eta )
y |
an n vector, assumed multivariate normal with mean μ and covariance Σ. |
A |
an k \times n matrix of constraints. |
b |
a k vector of inequality limits. |
eta |
an n vector of the test contrast, η. |
Sigma |
an n \times n matrix of the population covariance, Σ.
Not needed if |
p |
a vector of probabilities for which we return equivalent η^{\top}μ. |
level |
if |
Sigma_eta |
an n vector of Σ η. |
Inverts the constrained normal inference procedure described by Lee et al.
Let y be multivariate normal with unknown mean μ and known covariance Σ. Conditional on Ay <= b for conformable matrix A and vector b, and given constrast vector eta and level p, we compute η^{\top}μ such that the cumulative distribution of η^{\top}y equals p.
The values of η^{\top}μ which have the corresponding CDF.
An error will be thrown if we do not observe A y <= b.
Steven E. Pav shabbychef@gmail.com
Lee, J. D., Sun, D. L., Sun, Y. and Taylor, J. E. "Exact post-selection inference, with application to the Lasso." Ann. Statist. 44, no. 3 (2016): 907-927. doi:10.1214/15-AOS1371. https://arxiv.org/abs/1311.6238
the CDF function, pconnorm
.
set.seed(1234) n <- 10 y <- rnorm(n) A <- matrix(rnorm(n*(n-3)),ncol=n) b <- A%*%y + runif(nrow(A)) Sigma <- diag(runif(n)) mu <- rnorm(n) eta <- rnorm(n) pval <- pconnorm(y=y,A=A,b=b,eta=eta,mu=mu,Sigma=Sigma) cival <- ci_connorm(y=y,A=A,b=b,eta=eta,Sigma=Sigma,p=pval) stopifnot(abs(cival - sum(eta*mu)) < 1e-4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.