forked from PRML/PRMLT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
12 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function x = dirichletRnd(a, m) | ||
% Sampling from a Dirichlet distribution. | ||
% a: k dimensional vector | ||
% m: k dimensional mean vector | ||
% Written by Mo Chen ([email protected]). | ||
if nargin == 2 | ||
a = a*m; | ||
end | ||
x = gamrnd(a,1); | ||
x = x/sum(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function x = rndDiscrete(p, n) | ||
function x = discreteRnd(p, n) | ||
% Sampling from a discrete distribution (multinomial). | ||
% Written by Mo Chen ([email protected]). | ||
if nargin == 1 | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function [X, z, center] = rndKmeans(d, k, n) | ||
function [X, z, center] = kmeansRnd(d, k, n) | ||
% Sampling from a Gaussian mixture distribution with common variances (kmeans model). | ||
% Written by Michael Chen ([email protected]). | ||
a = 1; | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.