monitor_mmc: Format the optimization method controls

Description Usage Arguments Value Examples

View source: R/monitor.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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)

MaxMC documentation built on May 1, 2019, 10:16 p.m.