mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-30 23:36:23 +02:00
Merge pull request #574 from alansaul/lyapunov_fix
Fixing scipy=1.0.0 incompatibility of lyapunov discovered in PR #573. Coverage issue should be resolved by PR #575.
This commit is contained in:
commit
4e1b7dfad4
2 changed files with 10 additions and 2 deletions
|
|
@ -9,6 +9,10 @@ from .stationary import RatQuad
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import scipy as sp
|
import scipy as sp
|
||||||
|
try:
|
||||||
|
from scipy.linalg import solve_continuous_lyapunov as lyap
|
||||||
|
except ImportError:
|
||||||
|
from scipy.linalg import solve_lyapunov as lyap
|
||||||
|
|
||||||
class sde_RBF(RBF):
|
class sde_RBF(RBF):
|
||||||
"""
|
"""
|
||||||
|
|
@ -67,7 +71,7 @@ class sde_RBF(RBF):
|
||||||
H[0,0] = 1
|
H[0,0] = 1
|
||||||
|
|
||||||
# Infinite covariance:
|
# Infinite covariance:
|
||||||
Pinf = sp.linalg.solve_lyapunov(F, -np.dot(L,np.dot( Qc[0,0],L.T)))
|
Pinf = lyap(F, -np.dot(L,np.dot( Qc[0,0],L.T)))
|
||||||
Pinf = 0.5*(Pinf + Pinf.T)
|
Pinf = 0.5*(Pinf + Pinf.T)
|
||||||
# Allocating space for derivatives
|
# Allocating space for derivatives
|
||||||
dF = np.empty([F.shape[0],F.shape[1],2])
|
dF = np.empty([F.shape[0],F.shape[1],2])
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ from .stationary import RatQuad
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import scipy as sp
|
import scipy as sp
|
||||||
|
try:
|
||||||
|
from scipy.linalg import solve_continuous_lyapunov as lyap
|
||||||
|
except ImportError:
|
||||||
|
from scipy.linalg import solve_lyapunov as lyap
|
||||||
|
|
||||||
class sde_RBF(RBF):
|
class sde_RBF(RBF):
|
||||||
"""
|
"""
|
||||||
|
|
@ -69,7 +73,7 @@ class sde_RBF(RBF):
|
||||||
H[0,0] = 1
|
H[0,0] = 1
|
||||||
|
|
||||||
# Infinite covariance:
|
# Infinite covariance:
|
||||||
Pinf = sp.linalg.solve_lyapunov(F, -np.dot(L,np.dot( Qc[0,0],L.T)))
|
Pinf = lyap(F, -np.dot(L,np.dot( Qc[0,0],L.T)))
|
||||||
Pinf = 0.5*(Pinf + Pinf.T)
|
Pinf = 0.5*(Pinf + Pinf.T)
|
||||||
# Allocating space for derivatives
|
# Allocating space for derivatives
|
||||||
dF = np.empty([F.shape[0],F.shape[1],2])
|
dF = np.empty([F.shape[0],F.shape[1],2])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue