⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mixpar2theta.r

📁 这个包里面含有利用极大似然估计方法来拟合成组数据和条件数据的有限混合分布模型的函数
💻 R
字号:
## last modified June 2002

mixpar2theta <- function(mixpar, constr, mixprop = TRUE) 
{
    k <- nrow(mixpar)
    if (constr$conmu == "NONE") 
        mu.e <- mixpar[, 2]
    else if (constr$conmu == "MFX") 
        mu.e <- mixpar[!constr$fixmu, 2]
    else if (constr$conmu == "MEQ") 
        mu.e <- mixpar[1, 2]
    else if (constr$conmu == "MES") 
        mu.e <- mixpar[1:2, 2]
    else if (constr$conmu == "MGC") 
        mu.e <- mixpar[1:3, 2]
    if (constr$consigma == "NONE") 
        sigma.e <- log(mixpar[, 3])
    else if (constr$consigma == "SFX") 
        sigma.e <- log(mixpar[!constr$fixsigma, 3])
    else if (!is.na(match(constr$consigma, c("FCV", "BINOM", 
        "NBINOM", "POIS")))) 
        sigma.e <- NULL
    else if (!is.na(match(constr$consigma, c("CCV", "SEQ")))) 
        sigma.e <- log(mixpar[1, 3])
    if (mixprop) {
        if (constr$conpi == "NONE") 
            pi.e <- mixpar[-k, 1]
        else if (constr$conpi == "PFX" & sum(constr$fixpi) < 
            k - 1) {
            pi.e <- mixpar[!constr$fixpi, 1]
            lpi <- length(pi.e)
            pi.e <- pi.e[-lpi]
        }
        else if (constr$conpi == "PFX" & sum(constr$fixpi) >= 
            k - 1) 
            pi.e <- NULL
    }
    else pi.e <- NULL
    c(pi.e, mu.e, sigma.e)
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -