Exemple #1
0
	def __init__(self, observations, timepoints, xkernel=cov.sq_exp_kernel(), ykernel=cov.sq_exp_kernel()):
		zt = observations[:,0]
		zx = observations[:,1]
		zy = observations[:,2]

		self.xgp = GaussianProcess(zt, zx, timepoints, xkernel)
		self.ygp = GaussianProcess(zt, zy, timepoints, ykernel)
Exemple #2
0
    def __init__(self,
                 observations,
                 timepoints,
                 xkernel=cov.sq_exp_kernel(),
                 ykernel=cov.sq_exp_kernel()):
        zt = observations[:, 0]
        zx = observations[:, 1]
        zy = observations[:, 2]

        self.xgp = GaussianProcess(zt, zx, timepoints, xkernel)
        self.ygp = GaussianProcess(zt, zy, timepoints, ykernel)
Exemple #3
0
    def __init__(self, zx, zy, testpoints, kernel=cov.sq_exp_kernel()):
        ''' Creates a new Gaussian process from the given observations. '''
        self.timepoints = testpoints
        self.kernel = kernel

        # covariance of observations
        self.K = kernel(zx, zx, 'train')
        self.K += 1e-9 * np.eye(self.K.shape[0])
        Ltrain = np.linalg.cholesky(self.K)

        # compute the predictive mean at our test points
        self.Kstar = kernel(zx, testpoints, 'cross')
        v = np.linalg.solve(Ltrain, self.Kstar)
        self.mu = np.dot(v.T, np.linalg.solve(Ltrain, zy))

        # compute the predictive variance at our test points
        self.Kss = kernel(testpoints, testpoints, 'test')
        self.Kss += 1e-9 * np.eye(self.Kss.shape[0])
        self.prior_L = np.linalg.cholesky(self.Kss)

        self.Kss = self.kernel(testpoints, testpoints, 'train')
        # 		self.Kss += 1e-3*np.eye(self.Kss.shape[0])
        self.L = np.linalg.cholesky(self.Kss - np.dot(v.T, v))
Exemple #4
0
	def __init__(self, zx, zy, testpoints, kernel=cov.sq_exp_kernel()):
		''' Creates a new Gaussian process from the given observations. '''
		self.timepoints = testpoints
		self.kernel = kernel
		
		# covariance of observations
		self.K = kernel(zx, zx, 'train')
		self.K += 1e-9*np.eye(self.K.shape[0])
		Ltrain = np.linalg.cholesky(self.K)
		
		# compute the predictive mean at our test points
		self.Kstar = kernel(zx, testpoints, 'cross')
		v = np.linalg.solve(Ltrain, self.Kstar)
		self.mu = np.dot(v.T, np.linalg.solve(Ltrain, zy))
		
		# compute the predictive variance at our test points
		self.Kss = kernel(testpoints, testpoints, 'test')
		self.Kss += 1e-9*np.eye(self.Kss.shape[0])
		self.prior_L = np.linalg.cholesky(self.Kss)
		
		self.Kss = self.kernel(testpoints, testpoints, 'train')
# 		self.Kss += 1e-3*np.eye(self.Kss.shape[0])
		self.L = np.linalg.cholesky(self.Kss - np.dot(v.T, v))
Exemple #5
0
 def __init__(self,
              xkernel=cov.sq_exp_kernel(),
              ykernel=cov.sq_exp_kernel()):
     self.xkernel = xkernel
     self.ykernel = ykernel
Exemple #6
0
	def __init__(self, xkernel=cov.sq_exp_kernel(), ykernel=cov.sq_exp_kernel()):
		self.xkernel = xkernel
		self.ykernel = ykernel