Пример #1
0
import ESutils
import scipy as sp
from scipy import linalg as spl
from scipy import stats as sps
from matplotlib import pyplot as plt


#uniform test
class bob:
    def __init__(self, D):
        self.D = D
        return


X = ESutils.draw_support_inplane(bob(2), sp.array([-2, -1]), sp.array([0, 3]),
                                 500, ESutils.SUPPORT_UNIFORM, 1, 0.5)
for i in xrange(X.shape[0]):
    plt.plot(X[i, 0], X[i, 1], 'r.')
plt.axis([-5, 5, -5, 5])

#2d gp test

import GPdc

nt = 34
X = ESutils.draw_support(bob(2), sp.array([-1., -1.]), sp.array([1., 1.]), nt,
                         ESutils.SUPPORT_UNIFORM)
D = [[sp.NaN]] * (nt)
hyp = sp.array([1.5, 0.15, 0.15])
kf = GPdc.gen_sqexp_k_d(hyp)
Kxx = GPdc.buildKsym_d(kf, X, D)
Пример #2
0
def drawmins_inplane(G,n,lb,ub,axis,value, SUPPORT=300, mode=ESutils.SUPPORT_SLICELCB, SLICELCB_PARA=1.):
    W = sp.vstack([ESutils.draw_support_inplane(G, lb,ub,SUPPORT/len(mode),m, axis,value,para = SLICELCB_PARA) for m in mode])
    #draw in samples on the support
    R = ESutils.draw_min(G,W,n)
    return R
Пример #3
0
# and open the template in the editor.

import ESutils
import scipy as sp
from scipy import linalg as spl
from scipy import stats as sps
from matplotlib import pyplot as plt

#uniform test
class bob:
    def __init__(self,D):
        self.D=D
        return


X = ESutils.draw_support_inplane(bob(2), sp.array([-2,-1]),sp.array([0,3]),500,ESutils.SUPPORT_UNIFORM,1,0.5)
for i in xrange(X.shape[0]):
    plt.plot(X[i,0],X[i,1],'r.')
plt.axis([-5,5,-5,5])


#2d gp test

import GPdc

nt=34
X = ESutils.draw_support(bob(2), sp.array([-1.,-1.]),sp.array([1.,1.]),nt,ESutils.SUPPORT_UNIFORM)
D = [[sp.NaN]]*(nt)
hyp = sp.array([1.5,0.15,0.15])
kf = GPdc.gen_sqexp_k_d(hyp)
Kxx = GPdc.buildKsym_d(kf,X,D)