楼主: 青衣默东行
1281 3

[问答] R源代码求解释。 [推广有奖]

  • 1关注
  • 1粉丝

已卖:231份资源

硕士生

60%

还不是VIP/贵宾

-

威望
0
论坛币
2687 个
通用积分
0.3645
学术水平
2 点
热心指数
2 点
信用等级
2 点
经验
5470 点
帖子
92
精华
0
在线时间
217 小时
注册时间
2015-5-14
最后登录
2018-6-11

楼主
青衣默东行 发表于 2016-11-4 11:35:53 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
function (suffStat, indepTest, alpha, labels, p, skel.method = c("stable",
    "original", "stable.fast"), type = c("normal", "anytime",
    "adaptive"), fixedGaps = NULL, fixedEdges = NULL, NAdelete = TRUE,
    m.max = Inf, pdsep.max = Inf, rules = rep(TRUE, 10), doPdsep = TRUE,
    biCC = FALSE, conservative = FALSE, maj.rule = FALSE, verbose = FALSE)
{
    cl <- match.call()
    if (!missing(p))
        stopifnot(is.numeric(p), length(p <- as.integer(p)) ==
            1, p >= 2)
    if (missing(labels)) {
        if (missing(p))
            stop("need to specify 'labels' or 'p'")
        labels <- as.character(seq_len(p))
    }
    else {
        stopifnot(is.character(labels))
        if (missing(p)) {
            p <- length(labels)
        }
        else if (p != length(labels))
            stop("'p' is not needed when 'labels' is specified, and must match length(labels)")
        else message("No need to specify 'p', when 'labels' is given")
    }
    type <- match.arg(type)
    if (type == "anytime" && m.max == Inf)
        stop("To use the Anytime FCI you must specify a finite 'm.max'.")
    if (type == "adaptive" && m.max != Inf)
        stop("To use the Adaptive Anytime FCI you must not specify 'm.max'.")
    if (conservative && maj.rule)
        stop("Choose either conservative FCI or majority rule FCI")
    cl <- match.call()
    if (verbose)
        cat("Compute Skeleton\n================\n")
    skel <- skeleton(suffStat, indepTest, alpha, labels = labels,
        method = skel.method, fixedGaps = fixedGaps, fixedEdges = fixedEdges,
        NAdelete = NAdelete, m.max = m.max, verbose = verbose)
    skel@call <- cl
    G <- as(skel@graph, "matrix")
    sepset <- skel@sepset
    pMax <- skel@pMax
    n.edgetestsSKEL <- skel@n.edgetests
    max.ordSKEL <- skel@max.ord
    allPdsep <- NA
    tripleList <- NULL
    if (doPdsep) {
        if (verbose)
            cat("\nCompute PDSEP\n=============\n")
        pc.ci <- pc.cons.intern(skel, suffStat, indepTest, alpha = alpha,
            version.unf = c(1, 1), maj.rule = FALSE, verbose = verbose)
        pdsepRes <- pdsep(skel@graph, suffStat, indepTest = indepTest,
            p = p, sepset = pc.ci$sk@sepset, alpha = alpha, pMax = pMax,
            m.max = if (type == "adaptive")
                max.ordSKEL
            else m.max, pdsep.max = pdsep.max, NAdelete = NAdelete,
            unfVect = pc.ci$unfTripl, biCC = biCC, verbose = verbose)
        G <- pdsepRes$G
        sepset <- pdsepRes$sepset
        pMax <- pdsepRes$pMax
        allPdsep <- pdsepRes$allPdsep
        n.edgetestsPD <- pdsepRes$n.edgetests
        max.ordPD <- pdsepRes$max.ord
        if (conservative || maj.rule) {
            if (verbose)
                cat("\nCheck v-structures conservatively\n=================================\n")
            tmp.pdsep <- new("pcAlgo", graph = as(G, "graphNEL"),
                call = cl, n = integer(0), max.ord = as.integer(max.ordSKEL),
                n.edgetests = n.edgetestsSKEL, sepset = sepset,
                pMax = pMax, zMin = matrix(NA, 1, 1))
            sk. <- pc.cons.intern(tmp.pdsep, suffStat, indepTest,
                alpha, verbose = verbose, version.unf = c(1,
                  1), maj.rule = maj.rule)
            tripleList <- sk.$unfTripl
            sepset <- sk.$sk@sepset
        }
    }
    else {
        n.edgetestsPD <- 0
        max.ordPD <- 0
        allPdsep <- vector("list", p)
        if (conservative || maj.rule) {
            if (verbose)
                cat("\nCheck v-structures conservatively\n=================================\n")
            nopdsep <- pc.cons.intern(skel, suffStat, indepTest,
                alpha, verbose = verbose, version.unf = c(2,
                  1), maj.rule = maj.rule)
            tripleList <- nopdsep$unfTripl
            sepset <- nopdsep$sk@sepset
        }
    }
    if (verbose)
        cat("\nDirect egdes:\n=============\nUsing rules:", which(rules),
            "\nCompute collider:\n")
    res <- udag2pag(pag = G, sepset, rules = rules, unfVect = tripleList,
        verbose = verbose)
    colnames(res) <- rownames(res) <- labels
    new("fciAlgo", amat = res, call = cl, n = integer(0), max.ord = as.integer(max.ordSKEL),
        max.ordPDSEP = as.integer(max.ordPD), n.edgetests = n.edgetestsSKEL,
        n.edgetestsPDSEP = n.edgetestsPD, sepset = sepset, pMax = pMax,
        allPdsep = allPdsep)
}
<bytecode: 0x000000001152b818>
<environment: namespace:pcalg>
> ? match.call
starting httpd help server ... done
>


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:源代码 Conservative function Adaptive Original 源代码

沙发
青衣默东行 发表于 2016-11-4 11:39:00
是R中关于FCI算法的源代码,看不懂这些什么意思,或者告诉一下可以看哪些资料?

藤椅
青衣默东行 发表于 2016-11-4 12:31:56
有没有大神

板凳
青衣默东行 发表于 2016-11-6 18:39:07
???

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 16:36