mouthwash_second_step: The second step of MOUTHWASH.

Description Usage Arguments Author(s) References

View source: R/mouthwash.R

Description

The second step of MOUTHWASH.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
mouthwash_second_step(
  betahat_ols,
  S_diag,
  alpha_tilde,
  lambda_seq,
  tau2_seq = NULL,
  a_seq = NULL,
  b_seq = NULL,
  mixing_dist = c("normal", "uniform", "+uniform", "sym_uniform"),
  likelihood = c("normal", "t"),
  pi_init_type = c("zero_conc", "uniform", "random"),
  scale_var = TRUE,
  degrees_freedom = NULL,
  plot_update = FALSE,
  sprop = 0,
  var_inflate_pen = 0,
  verbose = TRUE
)

Arguments

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.

lambda_seq

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

tau2_seq

The grid of variances of the mixing distributions if mixing_dist = "normal". Only one of tau2_seq or a_seq and b_seq need be specified.

a_seq

The grid of lower bounds for the uniforms if mixing_dist is one of the uniforms.

b_seq

The grid of upper bounds for the uniforms if mixing_dist is one of the uniforms.

mixing_dist

A character. Should we use a mixture of uniforms ("uniform"), a mixture of uniforms with minimum at 0 ("+uniform"), a mixture of uniforms symmetric at 0 ("sym_uniform"), or a mixture of normals ("normal")?

likelihood

Either "normal" or "t". If likelihood = "t", then the user may provide the degrees of freedom via degrees_freedom.

pi_init_type

How should we initialize the mixing proportions? By concentrating on zero ("zero_conc"), by equal weights on all mixing distributions ("uniform"), or by sampling uniformly on the simplex ("random")?

scale_var

A logical. Should we estimate a variance inflation parameter (TRUE) or not (FALSE)?

degrees_freedom

The degrees of freedom of the t-distribution if likelihood = "t".

plot_update

A logical. Should I plot the the path of the log-likelihood (TRUE) or not (FALSE)? Only applicable when mixing_dist is not "normal".

sprop

If b is an effect and s is an estimated standard error, then we model b/s^{sprop} as exchangeable. The default is 0. When sprop = 1, for identifiability reasons it must be the case that scale_var = 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.

verbose

If verbose = TRUE, print progress of the algorithm to the console.

Author(s)

David Gerard

References


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