Description Usage Arguments Value Examples
Routine for finding MASSIVE posterior local optimum.
1 2 3 4 5 6 7 8 9 10 11 12  | find_optimum(
  J,
  N,
  SS,
  sigma_G,
  prior_sd,
  skappa_X,
  skappa_Y,
  post_fun = scaled_neg_log_posterior,
  gr_fun = scaled_neg_log_gradient,
  hess_fun = scaled_neg_log_hessian
)
 | 
J | 
 Integer number of genetic instrumental variables.  | 
N | 
 Integer number of observations.  | 
SS | 
 Numeric matrix containing first- and second-order statistics.  | 
sigma_G | 
 Numeric vector of genetic IV standard deviations.  | 
prior_sd | 
 List of standard deviations for the parameter Gaussian priors.  | 
skappa_X | 
 Scale-free confounding coefficient to exposure used for initialization.  | 
skappa_Y | 
 Scale-free confounding coefficient to outcome used for initialization.  | 
post_fun | 
 Function for computing the IV model posterior value.  | 
gr_fun | 
 Function for computing the IV model posterior gradient.  | 
hess_fun | 
 Function for computing the IV model posterior Hessian.  | 
optim object (see optim containing optimum parameters, the value obtained at the optimum, and the Hessian at the optimum.
1 2 3 4 5 6 7 8 9 10  | J <- 5 # number of instruments
N <- 1000 # number of samples
parameters <- random_Gaussian_parameters(J) 
EAF <- runif(J, 0.1, 0.9) # EAF random values
dat <- generate_data_MASSIVE_model(N, 2, EAF, parameters)
find_optimum(
  J, N, dat$SS, binomial_sigma_G(dat$SS), 
  prior_sd = decode_IV_model(get_random_IV_model(J), 1, 0.01), 
  skappa_X = 1, skappa_Y = 1
)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.