R/update_theta.R

Defines functions update_theta

update_theta <- function(lambda1, x_j, Xj_star, alpha_hat, delta_hat,Xminusj_star){
  r_theta <- x_j - Xj_star%*%alpha_hat - delta_hat
  fit.theta <- glmnet(Xminusj_star, r_theta, standardize=FALSE, intercept=FALSE, lambda=lambda1, thresh=1e-12)
  theta <- as.matrix(fit.theta$beta)
  return(theta)
}

Try the latentgraph package in your browser

Any scripts or data that you put into this service are public.

latentgraph documentation built on Dec. 15, 2020, 5:23 p.m.