gemini_inference: gemini_inference

Description Usage Arguments Details Value Examples

View source: R/gemini_inference.R

Description

Estimate the posterior using a variational inference technique. Inference is performed through an iterative process until convergence.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
gemini_inference(
  Model,
  n_iterations = 20,
  mean_x = 1,
  sd_x = 1,
  mean_xx = 1,
  sd_xx = 1,
  mean_y = 0,
  sd_y = 10,
  mean_s = 0,
  sd_s = 10,
  threshold = 0.001,
  cores = 1,
  force_results = FALSE,
  verbose = FALSE,
  save_iterations = FALSE
)

Arguments

Model

an object of class gemini.model

n_iterations

a numeric indicating the maximum number of iterations (default=20).

mean_x

a numeric indicating prior mean of x (default=1).

sd_x

a numeric indicating prior sd of x (default=1).

mean_xx

a numeric indicating prior mean of xx (default=1).

sd_xx

a numeric indicating prior sd of xx (default=1)

mean_y

a numeric indicating prior mean of y (default=0)

sd_y

a numeric indicating prior sd of y (default=10).

mean_s

a numeric indicating prior mean of s(default=0)

sd_s

a numeric indicating prior sd of s (default=10)

threshold

a numeric indicating the threshold of change in MAE at which to stop the iterative process (default=0.001).

cores

a numeric indicating the number of cores to use. See details in gemini_parallel. (default=1)

force_results

a logical indicating if the CAVI algorithm should be halted if non-convergence is detected. (default=FALSE)

verbose

default FALSE

save_iterations

for especially large libraries that require long computations, saves the latest iteration of each update. default FALSE

Details

GEMINI uses the following parameters, which are described in Zamanighomi et al. and translated here for clarity:

Default parameters may need to be changed if convergence is not achieved. See README for more details.

Value

a gemini.model object with estimated posteriors

Examples

1
2
data("Model", package = "gemini")
Model %<>% gemini_inference(verbose = FALSE, n_iterations = 1) # iterations set to 1 for testing

sellerslab/gemini documentation built on April 9, 2021, 9:01 p.m.