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
62 changed files
with
62 additions
and
45 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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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,6 +1,5 @@ | ||
function z = pdfKdeLn (X, Y, sigma) | ||
% Compute log pdf of kernel density estimator. | ||
% Written by Mo Chen ([email protected]). | ||
D = bsxfun(@plus,full(dot(X,X,1)),full(dot(Y,Y,1))')-full(2*(Y'*X)); | ||
z = logSumExp(D/(-2*sigma^2),1)-0.5*log(2*pi)-log(sigma*size(Y,2)); | ||
endfunction | ||
% Written by Mo Chen ([email protected]). | ||
D = bsxfun(@plus,full(dot(X,X,1)),full(dot(Y,Y,1))')-full(2*(Y'*X)); | ||
z = logSumExp(D/(-2*sigma^2),1)-0.5*log(2*pi)-log(sigma*size(Y,2)); |
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
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
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,6 +1,6 @@ | ||
function y = pdfWishartLn(Sigma, v, W) | ||
% Compute log pdf of a Wishart distribution. | ||
% Written by Mo Chen (mochen80@gmail.com). | ||
% Written by Mo Chen (sth4nth@gmail.com). | ||
d = length(Sigma); | ||
B = -0.5*v*logdet(W)-0.5*v*d*log(2)-logmvgamma(0.5*v,d); | ||
y = B+0.5*(v-d-1)*logdet(Sigma)-0.5*trace(W\Sigma); |
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
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
% Compute linear model reponse y = w'*x+b and likelihood | ||
% X: d x n data | ||
% t: 1 x n response | ||
% Written by Mo Chen ([email protected]). | ||
w = model.w; | ||
b = model.w0; | ||
y = w'*X+b; | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
% Fit linear regression model t=w'x+b | ||
% X: d x n data | ||
% t: 1 x n response | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
lambda = 0; | ||
end | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
% Fit empirical Bayesian linear model with EM | ||
% X: d x n data | ||
% t: 1 x n response | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
alpha = 0.02; | ||
beta = 0.5; | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
% Fit empirical Bayesian linear model with Mackay fixed point method | ||
% X: d x n data | ||
% t: 1 x n response | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
alpha = 0.02; | ||
beta = 0.5; | ||
|
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,5 +1,6 @@ | ||
function U = classFda(X, y, d) | ||
% Fisher (linear) discriminant analysis | ||
% Written by Mo Chen ([email protected]). | ||
n = size(X,2); | ||
k = max(y); | ||
|
||
|
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,5 +1,6 @@ | ||
function [model, llh] = classLogitBin(X, t, lambda) | ||
% logistic regression for binary classification (Bernoulli likelihood) | ||
% Written by Mo Chen ([email protected]). | ||
if any(unique(t) ~= [0,1]) | ||
error('t must be a 0/1 vector!'); | ||
end | ||
|
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,5 +1,6 @@ | ||
function [model, llh] = classLogitMul(X, t, lambda, method) | ||
% logistic regression for multiclass problem (Multinomial likelihood) | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 4 | ||
method = 1; | ||
end | ||
|
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,2 +1,3 @@ | ||
function y = sigmoid(x) | ||
% Written by Mo Chen ([email protected]). | ||
y = 1./(1+exp(-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,7 +1,7 @@ | ||
function s = softmax(x, dim) | ||
% Compute softmax | ||
% By default dim = 1 (columns). | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
if nargin == 1, | ||
% Determine which dimension sum will use | ||
dim = find(size(x)~=1,1); | ||
|
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,5 +1,6 @@ | ||
function Kc = knCenterize(kn, X, Xt) | ||
% Centerize the data in the kernel space | ||
% Written by Mo Chen ([email protected]). | ||
K = kn(X,X); | ||
mK = mean(K); | ||
mmK = mean(mK); | ||
|
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,5 +1,6 @@ | ||
function K = knGauss(X, Y, s) | ||
% Gaussian (RBF) kernel | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
s = 1; | ||
end | ||
|
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,5 +1,6 @@ | ||
function [y, sigma, p] = knInfer(x, model) | ||
% inference for kernel model | ||
% Written by Mo Chen ([email protected]). | ||
kn = model.kn; | ||
a = model.a; | ||
X = model.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,5 @@ | ||
function K = knLin(X, Y) | ||
% Linear kernel (inner product) | ||
% Written by Mo Chen ([email protected]). | ||
K = X'*Y; | ||
|
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,5 +1,6 @@ | ||
function model = regressKn(X, t, lambda, kn) | ||
% Gaussian process for regression | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 4 | ||
kn = @knGauss; | ||
end | ||
|
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,6 +1,7 @@ | ||
function [model, llh] = classRvmEbEm(X, t, alpha) | ||
% Relevance Vector Machine classification training by empirical bayesian (ARD) | ||
% using standard EM update | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
alpha = 0.02; | ||
end | ||
|
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,6 +1,7 @@ | ||
function [model, llh] = classRvmEbFp(X, t, alpha) | ||
% Relevance Vector Machine classification training by empirical bayesian (ARD) | ||
% using fix point update (Mackay update) | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
alpha = 0.02; | ||
end | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
% t: 1 x n 0/1 label | ||
% A: d x d regularization penalty | ||
% w: d x 1 initial value of w | ||
|
||
% Written by Mo Chen ([email protected]). | ||
[d,n] = size(X); | ||
|
||
if nargin < 4 | ||
|
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
% Analysis of sparse Bayesian learning. NIPS(2002). By Faul and Tipping | ||
% Fast marginal likelihood maximisation for sparse Bayesian models. | ||
% AISTATS(2003). by Tipping and Faul | ||
% Written by Mo Chen ([email protected]). | ||
[d,n] = size(X); | ||
xbar = mean(X,2); | ||
tbar = mean(t,2); | ||
|
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,6 +1,7 @@ | ||
function [model, llh] = regressRvmEbEm(X, t, alpha, beta) | ||
% Relevance Vector Machine regression training by empirical bayesian (ARD) | ||
% using standard EM update | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
alpha = 0.02; | ||
beta = 0.5; | ||
|
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,6 +1,7 @@ | ||
function [model, llh] = regressRvmEbFp(X, t, alpha, beta) | ||
% Relevance Vector Machine regression training by empirical bayesian (ARD) | ||
% using fix point update (Mackay update) | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
alpha = 0.02; | ||
beta = 0.5; | ||
|
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,6 +1,7 @@ | ||
function [model, llh] = regressRvmEbFpSvd(X, t, alpha, beta) | ||
% Relevance Vector Machine regression training by empirical bayesian (ARD) | ||
% using fix point update (Mackay update) with SVD | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
alpha = 0.02; | ||
beta = 0.5; | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
% Perform k-means clustering. | ||
% X: d x n data matrix | ||
% k: number of seeds | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
n = size(X,2); | ||
last = 0; | ||
label = ceil(k*rand(1,n)); % random initialization | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
% Perform EM algorithm for fitting the Bernoulli mixture model. | ||
% X: d x n data matrix | ||
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k) | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
%% initialization | ||
fprintf('EM for mixture model: running ... \n'); | ||
n = size(X,2); | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
% Perform EM algorithm for fitting the Gaussian mixture model. | ||
% X: d x n data matrix | ||
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k) | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
%% initialization | ||
fprintf('EM for Gaussian mixture: running ... \n'); | ||
R = initialization(X,init); | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
% Perform EM algorithm for fitting the multinomial mixture model. | ||
% X: d x n data matrix | ||
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k) | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
%% initialization | ||
fprintf('EM for mixture model: running ... \n'); | ||
n = size(X,2); | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,8 +3,7 @@ | |
% X: d x n data matrix | ||
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k) | ||
% Reference: Pattern Recognition and Machine Learning by Christopher M. Bishop (P.474) | ||
% Written by Michael Chen ([email protected]). | ||
|
||
% Written by Mo Chen ([email protected]). | ||
fprintf('Variational Bayesian Gaussian mixture: running ... \n'); | ||
[d,n] = size(X); | ||
if nargin < 3 | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
% Fit empirical Bayesian linear model with EM | ||
% X: m x n data | ||
% t: 1 x n response | ||
% Written by Mo Chen ([email protected]). | ||
[m,n] = size(X); | ||
if nargin < 3 | ||
a0 = 1e-4; | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
% Fit empirical Bayesian linear model with EM | ||
% X: m x n data | ||
% t: 1 x n response | ||
% Written by Mo Chen ([email protected]). | ||
if nargin < 3 | ||
a0 = 1e-4; | ||
b0 = 1e-4; | ||
|
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,5 +1,5 @@ | ||
function x = rndDirichlet(a) | ||
% Sampling from a Dirichlet distribution. | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
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,6 +1,6 @@ | ||
function x = rndDiscrete(p, n) | ||
% Sampling from a discrete distribution (multinomial). | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
if nargin == 1 | ||
n = 1; | ||
end | ||
|
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,6 +1,6 @@ | ||
function x = rndGauss(mu,Sigma,n) | ||
% Sampling from a Gaussian distribution. | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
if nargin == 2 | ||
n = 1; | ||
end | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
% X: d x n data matrix | ||
% p: dimension of target space | ||
% Reference: Pattern Recognition and Machine Learning by Christopher M. Bishop | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
[d,n] = size(X); | ||
mu = mean(X,2); | ||
X = bsxfun(@minus,X,mu); | ||
|
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 |
---|---|---|
|
@@ -2,8 +2,7 @@ | |
% Perform standard PCA (spectral method). | ||
% X: d x n data matrix | ||
% p: dimension of target space (p>=1) or ratio (0<p<1) | ||
% Written by Michael Chen ([email protected]). | ||
|
||
% Written by Mo Chen ([email protected]). | ||
opts.disp = 0; | ||
opts.issym = 1; | ||
opts.isreal = 1; | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
% Reference: | ||
% Pattern Recognition and Machine Learning by Christopher M. Bishop | ||
% Probabilistic Principal Component Analysis by Michael E. Tipping & Christopher M. Bishop | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
|
||
[m,n] = size(X); | ||
mu = mean(X,2); | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
% Reference: | ||
% Pattern Recognition and Machine Learning by Christopher M. Bishop | ||
% EM algorithms for PCA and SPCA by Sam Roweis | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
[d,n] = size(X); | ||
X = bsxfun(@minus,X,mean(X,2)); | ||
W = rand(d,p); | ||
|
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 |
---|---|---|
|
@@ -5,8 +5,7 @@ | |
% Reference: | ||
% Pattern Recognition and Machine Learning by Christopher M. Bishop | ||
% Probabilistic Principal Component Analysis by Michael E. Tipping & Christopher M. Bishop | ||
% Written by Michael Chen ([email protected]). | ||
|
||
% Written by Mo Chen ([email protected]). | ||
[m,n] = size(X); | ||
if nargin < 3 | ||
a0 = 1e-4; | ||
|
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,6 +1,6 @@ | ||
function x = discreternd(p, n) | ||
% Sampling from a discrete distribution (multinomial). | ||
% Written by Michael Chen ([email protected]). | ||
% Written by Mo Chen ([email protected]). | ||
if nargin == 1 | ||
n = 1; | ||
end | ||
|
Oops, something went wrong.