包装以适合学生t分布的混合 [英] package to fit mixtures of student-t distributions
问题描述
我正在寻找一款软件(首选python,但实际上是存在jupyter内核的任何软件),以使数据样本适合t分布的混合.
I am looking for a piece of software (python preferred, but really anything for which a jupyter kernel exists) to fit a data sample to a mixture of t-distributions.
我已经搜索了很长一段时间,这似乎是一种模糊的尝试,因为大多数搜索结果都出现了高斯混合现象(对此我不感兴趣).
I searched quite a while already and it seems to be that this is a somehwat obscure endeavor as most search results turn up for mixture of gaussians (what I am not interested here).
T迄今为止,最有前途的候选人是"AdMit"和"MitSEM" R软件包.但是我不了解R,并且发现这些软件包的描述相当复杂,似乎它们的核心目标不是拟合t的混合物,而是将其用作完成其他任务的步骤.
TThe most promising candidates so far are the "AdMit" and "MitSEM" R packages. However I do not know R and find the description of these packages rather comlple and it seems their core objective is not the fitting of mixtures of t’s but instead use this as a step to accomplish something else.
这简而言之就是我要软件完成的工作:
This is in a nutshell what I want the software to accomplish:
为某些数据拟合t分布的混合,并估计每个数据的位置",比例"和自由度".
Fitting a mixture of t-distributions to some data and estimate the "location" "scale" and "degrees of freedom" for each.
我希望有人可以将我指向一个简单的程序包,我不敢相信这是一个晦涩的用例.
I hope someone can point me to a simple package, I can’t believe that this is such an obscure use case.
推荐答案
这似乎可行(在R中):
This seems to work (in 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除外,但这很难估计...)
The parameters are all reasonably close (except for the df for the second component, but this is a very tough thing to estimate ...)
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
这篇关于包装以适合学生t分布的混合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!