Mercurial > forge
changeset 10418:105701459d30 octave-forge
statistics: Adding explanation ofr the difference between the formulas in the book GPML and the one sin the function.
author | jpicarbajal |
---|---|
date | Fri, 08 Jun 2012 18:43:09 +0000 |
parents | 3e941efa9c47 |
children | 66ec9da43f53 |
files | main/statistics/inst/regress_gp.m |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/main/statistics/inst/regress_gp.m Fri Jun 08 18:39:56 2012 +0000 +++ b/main/statistics/inst/regress_gp.m Fri Jun 08 18:43:09 2012 +0000 @@ -46,6 +46,19 @@ x = [ones(1,size(x,1)); x']; + ## Juan Pablo Carbajal <carbajal@ifi.uzh.ch> + ## Note that in the book the equation (below 2.11) for the A reads + ## A = (1/sy^2)*x*x' + inv (Vp); + ## where sy is the scalar variance of the of the residuals (i.e y = x' * w + epsilon) + ## and epsilon is drawn from N(0,sy^2). Vp is the variance of the parameters w. + ## Note that + ## (sy^2 * A)^{-1} = (1/sy^2)*A^{-1} = (x*x' + sy^2 * inv(Vp))^{-1}; + ## and that the formula for the w mean is + ## (1/sy^2)*A^{-1}*x*y + ## Then one obtains + ## inv(x*x' + sy^2 * inv(Vp))*x*y + ## Looking at the formula bloew we see that Sp = (1/sy^2)*Vp + ## making the regression depend on only one parameter, Sp, and not two. A = x*x' + inv (Sp); K = inv (A); wm = K*x*y;