normal_mix_fix: A fixed point iteration for updating the mixing proportions...

Description Usage Arguments Value Author(s)

View source: R/mouthwash_normal_em.R

Description

A fixed point iteration for updating the mixing proportions and the confounders associated with the covariates of interest when using a mixture of normals prior.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
normal_mix_fix(
  pi_vals,
  z2,
  xi,
  betahat_ols,
  S_diag,
  alpha_tilde,
  tau2_seq,
  lambda_seq,
  scale_var = TRUE,
  var_inflate_pen = 0
)

Arguments

pi_vals

The current values of the mixing proportions.

z2

The current value of the unobserved confounders corresponding to the covariates of interest.

xi

The current value of the variance inflation parameter.

betahat_ols

A vector of numerics. The OLS estimates of the coefficients of interest.

S_diag

A vector of positive numerics. The estimated standard errors.

alpha_tilde

A matrix. The number of rows should be equal the length of betahat_ols. The number of columns should equal the number of hidden confounders.

tau2_seq

The grid of variances. This is the same thing as grid_seq in mouthwash_second_step if likelihood = "normal".

lambda_seq

A numeric vector with elements all greater than or equal to 1. These are the tuning parameters for the mixing proportions.

scale_var

Should we optimize over a variance inflation parameter (TRUE) or not (FALSE)?

var_inflate_pen

The penalty to apply on the variance inflation parameter. Defaults to 0, but should be something non-zero when alpha = 1 and scale_var = TRUE.

Value

A list with the following elements.

pi_vals: The update for pi_vals.

z2: The update for z2.

xi: The update for xi.

Author(s)

David Gerard


dcgerard/vicar documentation built on July 7, 2021, 1:08 p.m.