return_mmc | R Documentation |
mmc
.S3 class mmc
.
return_mmc(S0, y, statistic, dgp, est, lower, upper, N, type, method,
alpha, control, call, seed, lmc, opt_result, opt_trace)
S0 |
An atomic vector. Value of the test statistic applied to the data. |
y |
A vector or data frame. |
statistic |
A function or a character string that specifies
how the statistic is computed. The function needs to input the
|
dgp |
A function. The function inputs the first argument
|
est |
A vector with length of v. It is the starting
point of the algorithm. If |
lower |
A vector with length of v. Lower bounds for nuisance parameters under the null. See Details. |
upper |
A vector with length of v. Upper bounds for nuisance parameters under the null. See Details. |
N |
An atomic vector. Number of replications of the test statistic. |
type |
A character string. It specifies the type of test
the p-value function produces. The possible values are
|
method |
A character string. Type of algorithm to be
used for global optimization. The four available methods
are simulated annealing ( |
alpha |
An atomic vector. If |
control |
A list. Arguments to be used to control the
behavior of the algorithm chosen in |
call |
An object of class |
seed |
An integer vector. Value of |
lmc |
An object of class |
opt_result |
An object returning the optimization results. |
opt_trace |
An object returning the optimization results. |
# Generate typical data found inside the function mmc()
S0 <- 0
y <- rnorm(100)
statistic <- function(y, v) mean(y) * v
dgp <- function(y, v) sample(y, replace = TRUE)
est <- 1
lower <- -1
upper <- 1
N <- 99
type <- "geq"
method <- "GenSA"
alpha <- 0.05
control <- MaxMC:::get_control(method)
call <- call("mc",y= y, statistic = statistic, dgp = dgp, N = 99, type = type)
seed <- NULL
lmc <- list(pval = 0.10)
pval <- 0.65
opt_result <- list(value = 0.10)
opt_trace <- as.data.frame(matrix(data = NA, control$maxit, 3,
dimnames = list(NULL,c("ite","pval","max"))))
# Combine data and return it as an object of class 'mmc'
MaxMC:::return_mmc(S0 = S0, y = y, statistic = statistic, dgp = dgp, est = est, lower = lower,
upper = upper, N = N, type = type, method = method, alpha = alpha,
control = control, call = call, seed = seed, lmc = lmc,
opt_result = opt_result, opt_trace = opt_trace)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.