Skip to content

Commit

Permalink
more comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nth committed Dec 8, 2015
1 parent 6b6487f commit 4563c20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions chapter03/linRegEbEm.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
llh = -inf(1,maxiter+1);
for iter = 2:maxiter
A = beta*C;
A(dg) = A(dg)+alpha; % 3.81
A(dg) = A(dg)+alpha; % 3.81 3.54
U = chol(A);
V = U\I;
V = U\I; % A=inv(S)

w = beta*(V*(V'*Xt)); % 3.84
w2 = dot(w,w);
Expand All @@ -37,7 +37,7 @@
llh(iter) = 0.5*(d*log(alpha)+n*log(beta)-alpha*w2-beta*err-logdetA-n*log(2*pi)); % 3.86
if abs(llh(iter)-llh(iter-1)) < tol*abs(llh(iter-1)); break; end

trS = dot(V(:),V(:));
trS = dot(V(:),V(:)); % A=inv(S)
alpha = d/(w2+trS); % 9.63

gamma = d-alpha*trS; % 9.64
Expand Down
6 changes: 3 additions & 3 deletions chapter03/linRegEbFp.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
llh = -inf(1,maxiter+1);
for iter = 2:maxiter
A = beta*C;
A(dg) = A(dg)+alpha; % 3.81
A(dg) = A(dg)+alpha; % 3.81 3.54
U = chol(A);
V = U\I;
V = U\I; % A=inv(S)

w = beta*(V*(V'*Xt)); % 3.84
w2 = dot(w,w);
Expand All @@ -38,7 +38,7 @@
llh(iter) = 0.5*(d*log(alpha)+n*log(beta)-alpha*w2-beta*err-logdetA-n*log(2*pi)); % 3.86
if abs(llh(iter)-llh(iter-1)) < tol*abs(llh(iter-1)); break; end

trS = dot(V(:),V(:));
trS = dot(V(:),V(:)); % A=inv(S)
gamma = d-alpha*trS; % 3.91
alpha = gamma/w2; % 3.92
beta = (n-gamma)/err; % 3.95
Expand Down

0 comments on commit 4563c20

Please sign in to comment.