mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
xt
This commit is contained in:
parent
7247849441
commit
71891a95d3
1 changed files with 13 additions and 13 deletions
|
|
@ -22,22 +22,22 @@ from GPy.util.plot import gpplot, Tango, x_frame1D
|
||||||
import pylab as pb
|
import pylab as pb
|
||||||
|
|
||||||
class StateSpace_1(Model):
|
class StateSpace_1(Model):
|
||||||
def __init__(self, T,X, Y, kernel=None):
|
def __init__(self, X, Y, kernel=None):
|
||||||
super(StateSpace_1, self).__init__()
|
super(StateSpace_1, self).__init__()
|
||||||
self.num_data, input_dim = X.shape
|
self.num_data, input_dim = X.shape
|
||||||
assert input_dim==2, "State space methods for time and space"
|
assert input_dim==1, "State space methods for time and space 2"
|
||||||
num_data_Y, self.output_dim = Y.shape
|
num_data_Y, self.output_dim = Y.shape
|
||||||
assert num_data_Y == self.num_data, "X and Y data don't match"
|
assert num_data_Y == self.num_data, "X and Y data don't match"
|
||||||
assert self.output_dim == 1, "State space methods for single outputs only"
|
assert self.output_dim == 1, "State space methods for single outputs only"
|
||||||
|
|
||||||
# Make sure the observations are ordered in time
|
# Make sure the observations are ordered in time
|
||||||
sort_index = np.argsort(T[:,0])
|
sort_index = np.argsort(X[:,0])
|
||||||
self.T = T[sort_index]
|
self.X = X[sort_index]
|
||||||
self.Y = Y[sort_index]
|
self.Y = Y[sort_index]
|
||||||
|
|
||||||
#sort_index = np.argsort(X[:,0])
|
sort_index = np.argsort(X[:,0])
|
||||||
#self.X = X[sort_index]
|
self.X = X[sort_index]
|
||||||
#self.Y = Y[sort_index]
|
self.Y = Y[sort_index]
|
||||||
|
|
||||||
# Noise variance
|
# Noise variance
|
||||||
self.sigma2 = 1.
|
self.sigma2 = 1.
|
||||||
|
|
@ -93,13 +93,13 @@ class StateSpace_1(Model):
|
||||||
Y = Y[return_index]
|
Y = Y[return_index]
|
||||||
|
|
||||||
# Get the model matrices from the kernel
|
# Get the model matrices from the kernel
|
||||||
(F1,L1,Qc1,H1,Pinf1) = self.kern.sde()
|
(F,L,Qc,H,Pinf) = self.kern.sde()
|
||||||
|
|
||||||
F = np.kron(eye(n),F1);
|
#F = np.kron(eye(n),F1);
|
||||||
L = np.kron(eye(n),L1);
|
#L = np.kron(eye(n),L1);
|
||||||
Qc = K*Qc1; #kron(K,Qc1);
|
#Qc = K*Qc1; #kron(K,Qc1);
|
||||||
H = np.kron(eye(n),H1);
|
#H = np.kron(eye(n),H1);
|
||||||
Pinf = np.kron(K,Pinf1);
|
#Pinf = np.kron(K,Pinf1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue