예제 #1
0
def get_hyper_pars(X, Y, cov):

    gpY = mGP(X, Y, cov)
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    res = gpY.min_loglikelihood()
    print(res)
    print(res.x)
    return res.x
예제 #2
0
    (rec,theta) = g.gp()
    (drec,theta) = g.dgp(thetatrain='False')
    (d2rec,theta) = g.d2gp()    
    
    #plt.show()
    return theta, rec, drec, d2rec
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#rec_dat = np.loadtxt('/home/ekli/myworks/cosmodata/Growth_tableII.txt', unpack=True)
data_path = '/home/ekli/myworks/cosmodata/'
rec_dat = np.loadtxt(data_path+'OHD_51.txt', unpack=True)
X = rec_dat[0]
Y = rec_dat[1]
err = rec_dat[2]
cov = np.eye(len(err))*err**2

gpY = mGP(X,Y,cov)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# using different bonds
#
#Ymax = np.max(Y)
#zmax = np.max(X)
#
##res = gpY.min_loglikelihood(2*Ymax, 2*zmax)
##print(res.x)
#
#for i in range(10):
#    res = gpY.min_loglikelihood(2*(i+1)*Ymax,2*(i+1)*zmax)
#    print('%3s-th is: '%(i+1), res.x)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~