mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
Added the sde representation to Matern32
This commit is contained in:
parent
7eba2f97e1
commit
8008df39eb
2 changed files with 20 additions and 0 deletions
|
|
@ -574,6 +574,10 @@ class kern(Parameterized):
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError, "Cannot plot a kernel with more than two input dimensions"
|
raise NotImplementedError, "Cannot plot a kernel with more than two input dimensions"
|
||||||
|
|
||||||
|
def sde(self):
|
||||||
|
# TODO: should support adding kernels together
|
||||||
|
return self.parts[0].sde()
|
||||||
|
|
||||||
from GPy.core.model import Model
|
from GPy.core.model import Model
|
||||||
|
|
||||||
class Kern_check_model(Model):
|
class Kern_check_model(Model):
|
||||||
|
|
@ -794,3 +798,4 @@ def kern_test(kern, X=None, X2=None, output_ind=None, verbose=False):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return pass_checks
|
return pass_checks
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,3 +137,18 @@ class Matern32(Kernpart):
|
||||||
# print "OLD \n", np.dot(F1lower,F1lower.T), "\n \n"
|
# print "OLD \n", np.dot(F1lower,F1lower.T), "\n \n"
|
||||||
# return(G)
|
# return(G)
|
||||||
return(self.lengthscale ** 3 / (12.*np.sqrt(3) * self.variance) * G + 1. / self.variance * np.dot(Flower, Flower.T) + self.lengthscale ** 2 / (3.*self.variance) * np.dot(F1lower, F1lower.T))
|
return(self.lengthscale ** 3 / (12.*np.sqrt(3) * self.variance) * G + 1. / self.variance * np.dot(Flower, Flower.T) + self.lengthscale ** 2 / (3.*self.variance) * np.dot(F1lower, F1lower.T))
|
||||||
|
|
||||||
|
def sde(self):
|
||||||
|
"""
|
||||||
|
Return the state space representation of the covariance.
|
||||||
|
"""
|
||||||
|
foo = np.sqrt(3)/self.lengthscale
|
||||||
|
F = np.array([[0, 1], [-foo**2, -2*foo]])
|
||||||
|
L = np.array([[0], [1]])
|
||||||
|
Qc = np.array([12*np.sqrt(3) / self.lengthscale**3 * self.variance])
|
||||||
|
H = np.array([[1, 0]])
|
||||||
|
Pinf = np.array([[self.variance, 0],
|
||||||
|
[0, 3*self.variance/(self.lengthscale**2)]])
|
||||||
|
# TODO: return the derivatives as well
|
||||||
|
return (F, L, Qc, H, Pinf)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue