tune_calibratedva: Chooses parameter values for calibration using WAIC

View source: R/calibration.R

tune_calibratedvaR Documentation

Chooses parameter values for calibration using WAIC

Description

Uses a grid search to choose the shrinkage parameter for calibration which gives the lowest WAIC values.

Usage

tune_calibratedva(
  va_unlabeled,
  va_labeled = NULL,
  gold_standard = NULL,
  causes,
  method = c("mshrink", "pshrink"),
  alpha_vec = NULL,
  lambda_vec = NULL,
  samples_list = NULL,
  which.multimodal = "all",
  which.rhat = "all",
  ...
)

Arguments

va_unlabeled

A matrix or list of causes for individuals without labeled causes of death. See calibratedva.

va_labeled

A matrix or list of causes for individuals with labeled causes of death. See calibratedva.

gold_standard

A matrix where each row represents either the true cause for an individual with a labeled cause of death. See calibratedva.

causes

A character vector with the names of the causes. These should correspond to the columns of A_U, A_L, and G_L

method

One of either "mshrink" (default) for M-shrinkage or "pshrink" for p-shrinkage

alpha_vec

If using M-shrinkage vector of values for alpha for which the function will evaluate the WAIC. If not provided, the function will auto-generate a vector.

lambda_vec

If using p-shrinkage vector of values for lambda for which the function will evaluate the WAIC. If not provided, the function will auto-generate a vector.

which.multimodal

A character specifying whether both p and M (which.multimodal = "all") should be evaluated for multimodality, or just p (which.multimodal = "p")

which.rhat

A character specifying whether both p and M (which.rhat = "all") should be evaluated for convergence, or just p (which.rhat = "p")

...

Additional arguments passed into calibratedva.

Value

A list with the following components.

final_model

A list with output specified in calibratedva object containing the posterior samples for the best value of the parameter (either alpha or lambda)

alpha_final

The chosen value of alpha for the posterior samples. Null if using p-shrinkage.

lambda_final

The chosen value of lambda for the posterior samples. Null if using M-shrinkage.

waic_df

A data frame containing a row for each parameter evaluated, which gives the WAIC, whether or not the posteriors were multimodal, and the Rhat of the posterior samples.


jfiksel/CalibratedVA documentation built on Nov. 14, 2022, 2:59 p.m.