In [32]:
import numpy as np
In [33]:
pred_y = np.load('/u/ki/swmclau2/Git/pearce/bin/covmat/pred_y.npy')
In [34]:
data_y = np.load('/u/ki/swmclau2/Git/pearce/bin/covmat/data_y.npy')
In [35]:
np.sum(np.all(data_y == 0.0, axis = 0))
Out[35]:
In [36]:
data_y.shape
Out[36]:
In [37]:
from matplotlib import pyplot as plt
%matplotlib inline
In [47]:
R = (10**pred_y- 10**data_y)/(10**data_y)
##R = (pred_y - data_y)
#cov = R.dot(R.T)/(R.shape[1]-1)
In [48]:
plt.hist(R[0]);
#plt.xscale('log')
#plt.yscale('log');
Out[48]:
In [54]:
10**data_y[0, R[0] > 1]
Out[54]:
In [55]:
10**pred_y[0, R[0]>1]
Out[55]:
In [13]:
idx = np.all(data_y==0.0, axis = 0)#)[0]
In [14]:
idx
Out[14]:
In [20]:
data_y[:, ~idx]
Out[20]:
In [21]:
pred_y[:,~idx]
Out[21]:
In [17]:
print (np.abs(10**pred_y - 10**data_y)/(10**data_y)).mean(axis =1)
In [19]:
print (np.abs(10**pred_y[:,~idx] - 10**data_y[:,~idx])/(10**data_y[:,~idx])).mean(axis =1)
In [23]:
1000*16%88
Out[23]:
In [27]:
output = np.load('/nfs/slac/g/ki/ki18/des/swmclau2/xi_gg_corrabzheng07_test_v2/output_0200.npy')
In [28]:
np.any(np.all(output == 0.0, axis = 1) )
Out[28]:
In [29]:
np.all(output==0.0, axis = 1)
Out[29]:
In [42]:
output[264%88]
Out[42]:
In [43]:
import h5py
In [44]:
f = h5py.File('/nfs/slac/g/ki/ki18/des/swmclau2/xi_gg_corrabzheng07_test_v2/PearceXiggCosmoCorrABTest.hdf5', 'r')
In [45]:
f['cosmo_no_00']['a_1.000']['obs'].value[265]
Out[45]:
In [46]:
from pearce.emulator import NashvilleHot
#from GPy.kern import *
import numpy as np
from os import path
#training_file = '/home/users/swmclau2/scratch/xi_gg_zheng07_cosmo_v4/PearceXiggCosmo.hdf5'
#test_file = '/home/users/swmclau2/scratch/xi_gg_zheng07_cosmo_test_v4/PearceXiggCosmoTest.hdf5'
training_file = '/nfs/slac/g/ki/ki18/des/swmclau2/xi_gg_corrabzheng07_v2/PearceXiggCosmoCorrAB.hdf5'
test_file = '/nfs/slac/g/ki/ki18/des/swmclau2/xi_gg_corrabzheng07_test_v2/PearceXiggCosmoCorrABTest.hdf5'
em_method = 'gp'
fixed_params = {'z':0.0}
hyperparams = {}
emu = NashvilleHot(training_file, hyperparams=hyperparams,fixed_params = fixed_params, downsample_factor = 0.1)
In [ ]:
pred_y, data_y = emu.goodness_of_fit(test_file, statistic = None)
In [ ]: