fix_caw: A fixed point iteration for CAW.

Description Usage Arguments Author(s)

View source: R/caw.R

Description

A fixed point iteration for CAW.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fix_caw(
  w_current,
  Z2hat,
  scale_val,
  rotate_out,
  weight_func = ash_wrap,
  weight_args = list(),
  min_scale = 0.8,
  return_val = c("params", "full")
)

Arguments

w_current

A vector of weights. The probability given Z2hat that each coefficient is null. These should all be between 0 and 1.

Z2hat

A matrix. The current estimates of the unobserved confounders.

scale_val

A positive numeric. The variance inflation term.

rotate_out

The output from rotate_model with degrees_freedom added to the list.

weight_func

The function that calculates the weights given w_current. So far, this only supports functions that take as input three quantities: betahat, sebetahat, and degrees_freedom

weight_args

Additional arguments to pass to weight_func.

min_scale

A scalar. The minimum value that scale_val is allowed to take. In practice, you wouldn't think that shrinking the variance is a good idea. But a value of 1 seems to stringent. So I set this to 0.8 to give you some wiggle room. Most of the time scale_val is usually estimated greater than 1.

return_val

Should we return just the parameters of interest ("params"), or the full shebang ("full")? Setting return_val = "params" is used mostly for the optimization and returns only w_current, Z2hat, and scale_val.

Author(s)

David Gerard


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