包以适应学生-t 分布的混合

package to fit mixtures of student-t distributions

我正在寻找一款软件(python 首选,但实际上存在 jupyter 内核的任何软件)以将数据样本拟合到混合的 t 分布。

我已经搜索了很长时间,这似乎是一个有点晦涩的尝试,因为大多数搜索结果都是高斯混合(我在这里不感兴趣)。

T到目前为止最有希望的候选者是 "AdMit" 和 "MitSEM" R 包。但是我不了解 R,发现这些包的描述相当复杂,而且它们的核心 objective 似乎不是 t 的混合拟合,而是将其用作完成其他事情的步骤。

简而言之,这就是我希望软件完成的任务:

将 t 分布的混合拟合到某些数据并估计每个数据的 "location" "scale" 和 "degrees of freedom"。

我希望有人能给我指出一个简单的包,我不敢相信这是一个如此晦涩的用例。

这似乎有效(在 R 中):

模拟例子:

 set.seed(101)
 x <- c(5+ 3*rt(1000,df=5),
        10+1*rt(10000,df=20))

适合:

 library(teigen)
 tt <- teigen(x,
        Gs=2,   # two components
        scale=FALSE,dfupdate="numeric",
        models=c("univUU")  # univariate model, unconstrained scale and df
        # (i.e. scale and df can vary between components)
 )

所有参数都相当接近(除了第二个分量的 df,但这是一个很难估计的东西...)

 tt$parameters[c("df","mean","sigma","pig")]
 ## $df    ## degrees of freedom
 ## [1]  3.578491 47.059841  
 ## $mean  ## ("location")
 ##           [,1]
 ## [1,]  4.939179
 ## [2,] 10.002038
 ## $sigma    ## reporting variance rather than sd (I think?)
 ## , , 1
 ##          [,1]
 ## [1,] 8.763076
 ## , , 2
 ##          [,1]
 ## [1,] 1.041588
 ## $pig     ## mixture probabilities
 ## [1] 0.09113273 0.90886727

晚会迟到了,但由于您更喜欢 Python,pypi 上似乎有几个适合有限学生 t 混合的软件包,包括:

https://pypi.org/project/studenttmixture/

https://pypi.org/project/student-mixture/

https://pypi.org/project/smm/

所以所有这些都可以用 pip 安装。

Scikit-learn 和其他常见的嫌疑人目前显然没有此功能。