如何打开特定方法的代码?

时间:2013-10-26 19:07:43

标签: r

我试图在R中看到Sn或SnB方法的代码但是当我在 Copula 包中打开R函数gofCopula时,我看不到整个代码。如何访问特定方法的代码? 这是功能示例: gofCopula(copula, x, N=1000, method="SnB“)

当我输入gofCopula时,我只看到这个:

function (copula, x, N = 1000, method = eval(formals(gofTstat)$method), 
    estim.method = eval(formals(fitCopula)$method), simulation = c("pb", 
        "mult"), verbose = TRUE, print.every = NULL, optim.method = "BFGS", 
    optim.control = list(maxit = 20), ...) 
{
    stopifnot(is(copula, "copula"), N >= 1)
    if (!is.matrix(x)) 
        x <- rbind(x, deparse.level = 0L)
    stopifnot((d <- ncol(x)) > 1, (n <- nrow(x)) > 0, dim(copula) == 
        d)
    method <- match.arg(method)
    estim.method <- match.arg(estim.method)
    optim.method <- match.arg(optim.method)
    simulation <- match.arg(simulation)
    stopifnot(optim.method %in% eval(formals(optim)$method))
    if (!is.null(print.every)) {
        warning("Argument 'print.every' is deprecated. Please use 'verbose' instead.")
        verbose <- print.every > 0
    }
    if (missing(estim.method) && !missing(method)) {
        eMeth <- eval(formals()$estim.method)
        if (!is.na(i <- pmatch(method, eMeth))) {
            warning("old (pre 0.999-*) argument 'method' is now called 'estim.method'")
            estim.method <- eMeth[i]
            method <- "Sn"
        }
    }
    switch(simulation, pb = {
        gofPB(copula, x, N = N, method = method, estim.method = estim.method, 
            verbose = verbose, optim.method = optim.method, optim.control = optim.control, 
            ...)
    }, mult = {
        gofMB(copula, x = x, N = N, method = method, estim.method = estim.method, 
            optim.method = optim.method, optim.control = optim.control, 
            ...)
    }, stop("Invalid simulation method ", simulation))
}
<environment: namespace:copula>

0 个答案:

没有答案