Пример #1
0

plt.show()

### zero mean (cond)

nlocObs = 100
nloc = res**2

locObs = gridLoc[0:nlocObs,:]
locPred = gridLoc[nlocObs:nloc,:]


valObs = newGP.rGP(gridLoc[0:nlocObs,:])

resCondGP = newGP.rCondGP(locPred, locObs, valObs)

resGP = np.concatenate((valObs, resCondGP))

#### to make plot ####

imGP = resGP.reshape(res,res)

x = np.linspace(0,1, res+1) 
y = np.linspace(0,1, res+1) 
X, Y = np.meshgrid(x,y) 

fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_aspect('equal')
Пример #2
0
    return (np.exp(x) / (1 + np.exp(x)))


import matplotlib.pyplot as plt

resGP = np.empty(shape=(niter - 1, res**2, 1))
# meanGP = np.zeros(shape=(res**2,1))
i = 0
t0 = time.time()
while (i < niter - 1):
    locations = np.loadtxt("locations" + str(i) + ".csv", delimiter=",")
    values = np.loadtxt("values" + str(i) + ".csv", delimiter=",")
    # np.savetxt("resGP"+str(i)+".csv",lams[i+1]*expit(newGP.rCondGP(gridLoc,locations,np.transpose([values]))) ,delimiter=",")
    newGP = GP(zeroMean, expCov(taus[i + 1], rhos[i + 1]))
    resGP[i] = lams[i + 1] * expit(
        newGP.rCondGP(gridLoc, locations, np.transpose([values])))
    # meanGP = ((i+1)*meanGP + lams[i+1]*expit(newGP.rCondGP(gridLoc,locations,np.transpose([values]))))/(i+2)

    # imGP = np.transpose(resGP[i].reshape(res,res))

    # x = np.linspace(0,1, res+1)
    # y = np.linspace(0,1, res+1)
    # X, Y = np.meshgrid(x,y)

    # fig = plt.figure()
    # ax = fig.add_subplot(111)
    # ax.set_aspect('equal')

    # plt.pcolormesh(X,Y,imGP, cmap='cool')

    # plt.xlim(0,1)