R包相当于Matlab';gms-distribution.fit()

R包相当于Matlab';gms-distribution.fit(),r,matlab,gaussian,R,Matlab,Gaussian,Matlab包含以下功能: obj = gmdistribution.fit(X,k) 如图所示 是否有提供此功能的R软件包?查看该软件包是否适合您的需要 install.packages("EMCluster") # excerpt from pg 12 of the EMCluster manual. library(EMCluster, quiet = TRUE) set.seed(1234) x <- da1$da ret.em <- init.EM(x, n

Matlab包含以下功能:

obj = gmdistribution.fit(X,k)
如图所示

是否有提供此功能的R软件包?

查看该软件包是否适合您的需要

 install.packages("EMCluster")

 # excerpt from pg 12 of the EMCluster manual.
 library(EMCluster, quiet = TRUE)
 set.seed(1234)
 x <- da1$da
 ret.em <- init.EM(x, nclass = 2, method = "em.EM")
 plotem(ret.em, x)
install.packages(“EMCluster”)
#摘自EMCluster手册第12页。
库(EMCluster,quiet=TRUE)
种子集(1234)

xMClust包包含函数densityClust,该函数生成一个对象,该对象包含拟合高斯混合模型的参数估计以及密度本身。从MClust手册:

>densWaiting摘要(densWaiting,parameters=TRUE)
-------------------------------------------------------
基于高斯有限混合模型的密度估计
-------------------------------------------------------
Mclust E(单变量、等方差)模型,含2个分量:
对数似然
n df
比克
-1034 272 4 -2090.4
聚类表:
1   2
99 173
混合概率:
1    2
0.36102 0.63898
指:
1    2
54.619 80.094
差异:
1    2
34.439 34.439
BIC选择具有相同方差的高斯变量的两分量混合。这个
可以从摘要输出中读取参数估计值。
可使用相应的绘图方法获得密度估算图:
>plot(densWaiting)密度也可以通过使用可选的
参数数据:
>绘图(登斯维特,数据=等待)
我在谷歌上搜索了“R中的高斯混合模型”,这是第一个链接。
> densWaiting <- densityMclust(faithful$waiting)
> summary(densWaiting, parameters = TRUE)
-------------------------------------------------------
Density estimation via Gaussian finite mixture modeling
-------------------------------------------------------
Mclust E (univariate, equal variance) model with 2 components:
log.likelihood
n df
BIC
-1034 272 4 -2090.4
Clustering table:
1   2
99 173
Mixing probabilities:
1    2
0.36102 0.63898
Means:
1    2
54.619 80.094
Variances:
1    2
34.439 34.439
 A two-components mixture of Gaussian variables with the same variance is selected by BIC. The
parameter estimates can be read from the summary output.
A plot of density estimate can be obtained using the corresponding plot method:

> plot(densWaiting)    The density can also be plotted together with a histogram of the observed data by using the optional
argument data:
> plot(densWaiting, data = faithful$waiting)