Skip to content

Commit

Permalink
Square the estimated variance in inference
Browse files Browse the repository at this point in the history
  • Loading branch information
pknight24 committed Jun 28, 2021
1 parent f011aef commit 651ce4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/inference.R
Expand Up @@ -76,7 +76,7 @@ inference <- function(KPR.output, mu = 1, r = 0.05, weight = TRUE, scale = FALSE
vectors.Q = eigen.Q$vectors[, eigen.Q$values > 0]
L.Q = vectors.Q%*%diag(sqrt(values.Q))

Z.tilde = t(L.H)%*%Z.p%*%vectors.Q
Z.tilde = t(L.H)%*%Z.p%*%L.Q
Y.tilde = t(L.H)%*%Y.p

### using natural lasso method
Expand Down Expand Up @@ -106,7 +106,7 @@ inference <- function(KPR.output, mu = 1, r = 0.05, weight = TRUE, scale = FALSE
cov.hat = Q%*%V%*%diag(D^(-2)*W*W)%*%t(V)%*%Q
diag.cov.hat = diag(cov.hat)
bound.mat = (Q%*%V%*%diag(W)%*%t(V) - (1- mu)*diag(Xi) - mu*diag(rep(1,p)))%*%vectors.Q
bound.hat = sigmaepsi.hat * apply(bound.mat, 1, function(x){max(abs(x))})*(log(p)/n)^(0.5 - r) # sparsity parameter
bound.hat = sigmaepsi.hat^2 * apply(bound.mat, 1, function(x){max(abs(x))})*(log(p)/n)^(0.5 - r) # sparsity parameter

# p-values
beta.temp = abs(beta.hat) - bound.hat
Expand Down

0 comments on commit 651ce4c

Please sign in to comment.