问题标签 [dirichlet]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
r - 如何拟合 Dirichlet 分布的有限混合
我有一个组成样本,我想拟合 Dirichlet 分布的有限混合。更准确地说,考虑以下示例:
X
包含从 3 部分单纯形中定义的狄利克雷分布混合生成的样本。该混合物的第一个 Dirichlet 分量具有参数 (1,1,1),第二个分量具有参数 (2,1,1),第三个分量具有参数 (1,1,20)。混合概率为 0.25、0.15、0.60。我想从示例中检索这些参数。
你如何找到这个参数?
scikit-learn - DP-GMM 和在线集群分配
我希望 scikit-learnDP-GMM
允许在给定新数据的情况下在线更新集群分配,但 sklearn 的实现DP-GMM
只有一个 fit 方法。
我对变分推理的理解尚不清楚,我认为无法在线更新集群分配是 sklearn 的实现所特有的,而不是无限 GMM 的变分推理。
如果有人能澄清这一点并指出能够在线更新集群分配的实现,我将非常感激!
http://scikit-learn.org/stable/modules/generated/sklearn.mixture.DPGMM.html
r - Having trouble with Dirichlet 3d plot
I'm trying to create a 3D plot of a random draw from a Dirichlet distribution but it only seems to be plotting in 2 dimensions even though I have data for three variables.
As you can see, I tried in two ways, using two different packages. In the first, you can see in the image below that they y-values seem to be missing, but I'm not sure why.
When I try using a different package, not only are the y-values missing, but the other two values are plotted as if they are on a 45 degree line, which is not correct. Any help is greatly appreciated!
python - 使用 rpy2 从 Python 调用 R 库 DirichletReg
我正在尝试使用 Python 进行 Dirichlet 回归。不幸的是,我找不到可以完成这项工作的 Python 包。所以我尝试DirichletReg
使用. 调用 R 库rpy2
。但是,对我来说如何调用诸如DirichReg(Y ~ X1 + X2 + X3, data=predictorData)
where之类的回归函数并不是很直观Y = DR_data(compositionalData)
。我lm
在rpy2
. 但我的情况略有不同,因为Y
不是表中的列名而是 R 对象DR_data
。
我想知道这样做的正确方法是什么,或者是否有用于 Dirichlet 回归的 Python 包。
python - 使用 PyMC3 查找数据集的狄利克雷先验
如何使用 找到狄利克雷先验pymc3
?
我尝试了以下方法:
但它抛出了一个ValueError
:
已编辑
zipfy
应该是参数向量。
我试过这个:
[出去]:
我期待 dirichlet 先验(即参数数组)的大小为 1,但它的大小为 100。这是预期的行为吗?应该如何解释的输出trace['zipfy']
?啊,痕迹是从的步骤pm.sample(100)
?先验在model
对象内部?
因此,假设给定一个离散值,5
我如何找到我刚刚从采样器中学到的狄利克雷先验?它是在model
对象内部还是zipfy
对象内部?
r - 具有多变量(3 个变量)的 DPdensity()
对于贝叶斯 Dirichelt 过程混合模型,我使用了 DP 包和 DPdensity()。DPdensity() 适用于单变量和双变量,但不适用于多变量。
但是,我使用了具有 3 个变量的数据,它没有给出 x1、x2 或 fun1、fun2 和没有 dens,而是计算集群的数量。所以看起来它计算和估计集群的数量,但我看到 dens 是 NULL。所以我用三个“nu”(如 nu1、nu2、nu3)更改了先前的参数。但仍然带有空的 x1、x2、fun1、fun2,我认为这不是一个解决方案
那么我需要为函数或先验更改哪些参数?或者我如何构建 x3 或 fun3 并获取 dens 列表?可以解决吗?谢谢你!!!
python - 如何从 PyMC3 中的 Dirichlet 过程中提取集群 ID 以获取分组数据?
我正在使用 PyMC3 对我的分组数据进行聚类。基本上,我有 g 个向量,并且想将 g 个向量聚集成 m 个簇。但是,我有两个问题。
第一个是,PyMC3 似乎只能处理一维数据而不能处理向量。第二个问题是,我不知道如何提取原始数据的集群 ID。我确实提取了组件的数量(k)和相应的权重。但是我无法提取指示每个点属于哪个集群的 id。
欢迎任何想法或意见!
r - R - sum of the values of points in different tiles (polygons) of a Voronoi diagram
I have the following df:
I'm using the x & y coords to generate a Voronoi tessellation enclosed by a rectangle:
Now say i have another df, df2:
I know I can count the sum of points (in df2) in each polygon of my Voronoi tessellation using spatstat & quadratcount, but what if I want to count the sum of the values in each polygon instead?
To give me something like:
r - 计算 R 中多元 Dirichlet 和 Gamma 分布的密度
我想计算多元狄利克雷分布的密度,并从这种分布中生成随机实现。就像函数 dmvnorm 对多元正态分布所做的那样。我为正态分布找到了这个,我想知道是否有一个函数可以为 Dirichlet 和 Gamma 分布做到这一点: