mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-27 22:06:22 +02:00
Added some comments
This commit is contained in:
parent
68eb83955c
commit
ad2c266c65
1 changed files with 12 additions and 1 deletions
|
|
@ -5,6 +5,9 @@ class student_t(GPy.likelihoods.likelihood_function):
|
|||
"""Student t likelihood distribution
|
||||
For nomanclature see Bayesian Data Analysis 2003 p576
|
||||
|
||||
$$\ln(\frac{\Gamma(\frac{(v+1)}{2})}{\Gamma(\sqrt(v \pi \Gamma(\frac{v}{2}))})+ \ln(1+\frac{(y_i-f_i)^2}{\sigma v})^{-\frac{(v+1)}{2}}$$
|
||||
TODO:Double check this
|
||||
|
||||
Laplace:
|
||||
Needs functions to calculate
|
||||
ln p(yi|fi)
|
||||
|
|
@ -17,6 +20,8 @@ class student_t(GPy.likelihoods.likelihood_function):
|
|||
|
||||
def link_function(self, y_i, f_i):
|
||||
"""link_function $\ln p(y_i|f_i)$
|
||||
$$\ln \Gamma(\frac{v+1}{2}) - \ln \Gamma(\frac{v}{2}) - \ln \frac{v \pi \sigma}{2} - \frac{v+1}{2}\ln (1 + \frac{(y_{i} - f_{i})^{2}}{v\sigma})$$
|
||||
TODO: Double check this
|
||||
|
||||
:y_i: datum number i
|
||||
:f_i: latent variable f_i
|
||||
|
|
@ -24,11 +29,15 @@ class student_t(GPy.likelihoods.likelihood_function):
|
|||
|
||||
"""
|
||||
e = y_i - f_i
|
||||
return gammaln((v+1)*0.5) - gammaln(v*0.5) - np.ln(v*np.pi*sigma)*0.5 - (v+1)*0.5*np.ln(1 + ((e/sigma)**2)/v)
|
||||
return gammaln((v+1)*0.5) - gammaln(v*0.5) - np.ln(v*np.pi*sigma)*0.5 - (v+1)*0.5*np.ln(1 + ((e/sigma)**2)/v) #Check the /v!
|
||||
|
||||
def link_grad(self, y_i, f_i):
|
||||
"""gradient of the link function at y_i, given f_i w.r.t f_i
|
||||
|
||||
derivative of log((gamma((v+1)/2)/gamma(sqrt(v*pi*gamma(v/2))))*(1+(t^2)/(a*v))^((-(v+1))/2)) with respect to t
|
||||
$$\frac{(y_i - f_i)(v + 1)}{\sigma v (y_{i} - f_{i})^{2}}$$
|
||||
TODO: Double check this
|
||||
|
||||
:y_i: datum number i
|
||||
:f_i: latent variable f_i
|
||||
:returns: float(gradient of likelihood evaluated at this point)
|
||||
|
|
@ -40,6 +49,8 @@ class student_t(GPy.likelihoods.likelihood_function):
|
|||
"""hessian at this point (the hessian will be 0 unless i == j)
|
||||
i.e. second derivative w.r.t f_i and f_j
|
||||
|
||||
second derivative of
|
||||
|
||||
:y_i: @todo
|
||||
:f_i: @todo
|
||||
:f_j: @todo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue