dirichrnd1.m

来自「Continuous Profile Models (CPM) Matlab T」· M 代码 · 共 17 行

M
17
字号
% function r = dirichrnd1(alpha)%% Obtain a single random sample from a Dirichlet distribution% with k-dimensional parameter vector alpha.%% The single sample obtained is the same dimension as alpha%% See dirichrnd to sample from more than one at a timefunction r = dirichrnd1(alpha)%% independent sample each dimension from a gamma distributionr = gamrnd(alpha,1,size(alpha));%% then normalize themr = r /sum(r);

⌨️ 快捷键说明

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