diff --git a/GPy/kern/src/sde_stationary.py b/GPy/kern/src/sde_stationary.py index 3ac5f402..8e7ad6f5 100644 --- a/GPy/kern/src/sde_stationary.py +++ b/GPy/kern/src/sde_stationary.py @@ -129,14 +129,14 @@ class sde_Exponential(Exponential): """ self.variance.gradient = gradients[0] - self.lengthscale.gradient = gradients[1] + self.lengthscale.gradient = gradients[1] * 2.0 def sde(self): """ Return the state space representation of the covariance. """ variance = float(self.variance.values) - lengthscale = float(self.lengthscale) + lengthscale = float(self.lengthscale*2.0) F = np.array(((-1.0/lengthscale,),)) L = np.array(((1.0,),)) diff --git a/GPy/models/state_space_main.py b/GPy/models/state_space_main.py index d65364e5..891c0326 100644 --- a/GPy/models/state_space_main.py +++ b/GPy/models/state_space_main.py @@ -3237,6 +3237,7 @@ class ContDescrStateSpace(DescreteStateSpace): AB = np.dot(AB, np.vstack((np.zeros((n,n)),np.eye(n)))) Q_noise_1 = linalg.solve(AB[n:,:].T,AB[:n,:].T) + Q_noise_2 = P_inf - A.dot(P_inf).dot(A.T) # The covariance matrix Q by matrix fraction decomposition <- if compute_derivatives: @@ -3276,8 +3277,9 @@ class ContDescrStateSpace(DescreteStateSpace): else: dA = None dQ = None - Q_noise = Q_noise_1 - + Q_noise = Q_noise_2 + # Innacuracies have been observed when Q_noise_1 was used. + #Q_noise = Q_noise_1 # Return @@ -3484,4 +3486,4 @@ def balance_ss_model(F,L,Qc,H,Pinf,P0,dF=None,dQc=None,dPinf=None,dP0=None): # (F,L,Qc,H,Pinf,P0,dF,dQc,dPinf,dP0) - return bF, bL, bQc, bH, bPinf, bP0, bdF, bdQc, bdPinf, bdP0, T \ No newline at end of file + return bF, bL, bQc, bH, bPinf, bP0, bdF, bdQc, bdPinf, bdP0, T