monitor_mmc: Format the optimization method controls

View source: R/monitor.R

monitor_mmcR Documentation

Format the optimization method controls

Description

This function provides a way to merge the user specified controls for the optimization methods with their respective default controls.

Usage

monitor_mmc(object, alpha = NULL, monitor = TRUE)

Arguments

object

A data.frame

alpha

An atomic vector. If mmc finds a p-value over alpha, then the algorithm will stop. This is particularly useful if we are only looking at testing a hypothesis at a particular level. Default is NULL.

monitor

A logical. If set to TRUE, then the p-values at every iteration and the cumulative maximum p-value are plotted on a graphical device. Default is FALSE.

Value

A list. Arguments to be used to control the behavior of the algorithm chosen in method.

Examples

# Create empty data frame to store the p-values at the different iterations
opt_trace <- as.data.frame(matrix(data = NA, 100, 3,
                                  dimnames = list(NULL,c("ite","pval","max"))))

# Generate some random p-values
for (ite in 1:100){
    pval <- runif(1,0,.6)
    opt_trace[ite,] <- c(ite, pval, max(pval, opt_trace$pval, na.rm = TRUE))
}

# Plot p-values for every iterations
MaxMC:::monitor_mmc(opt_trace, alpha = 0.05, monitor = TRUE)


julienneves/maxMC documentation built on June 24, 2024, 9:26 a.m.