Exemplo n.º 1
0
ind_test = ind_split[fold]  # np.sort(ind_shuffled[:N//10])
ind_train = np.concatenate(ind_split[np.arange(10) != fold])
x_train = x  # [ind_train]  # 90/10 train/test split
x_test = x  # [ind_test]
y_train = y  # [ind_train]
y_test = y  # [ind_test]
N_batch = 5000
M = 5000
# z = np.linspace(701050, 737050, M)
z = np.linspace(x[0], x[-1], M)

prior_1 = priors.Matern52(variance=2., lengthscale=5.5e4)
prior_2 = priors.QuasiPeriodicMatern32(variance=1., lengthscale_periodic=2., period=365., lengthscale_matern=1.5e4)
prior_3 = priors.QuasiPeriodicMatern32(variance=1., lengthscale_periodic=2., period=7., lengthscale_matern=30*365.)

prior = priors.Sum([prior_1, prior_2, prior_3])
lik = likelihoods.Poisson()

if method == 0:
    inf_method = approx_inf.EKS(damping=.5)
elif method == 1:
    inf_method = approx_inf.UKS(damping=.5)
elif method == 2:
    inf_method = approx_inf.GHKS(damping=.5)
elif method == 3:
    inf_method = approx_inf.EP(power=1, intmethod='GH', damping=.5)
elif method == 4:
    inf_method = approx_inf.EP(power=0.5, intmethod='GH', damping=.5)
elif method == 5:
    inf_method = approx_inf.EP(power=0.01, intmethod='GH', damping=.5)
elif method == 6:
Exemplo n.º 2
0
x_test = x[ind_test]
y_train = y[ind_train]
y_test = y[ind_test]

var_y = .1
var_f = 1.  # GP variance
len_f = 1.  # GP lengthscale
period = 1.  # period of quasi-periodic component
len_p = 5.  # lengthscale of quasi-periodic component
var_f_mat = 1.
len_f_mat = 1.

prior1 = priors.Matern32(variance=var_f_mat, lengthscale=len_f_mat)
prior2 = priors.QuasiPeriodicMatern12(variance=var_f, lengthscale_periodic=len_p,
                                      period=period, lengthscale_matern=len_f)
prior = priors.Sum([prior1, prior2])

lik = likelihoods.Gaussian(variance=var_y)

if method == 0:
    inf_method = approx_inf.EKS(damping=.1)
elif method == 1:
    inf_method = approx_inf.UKS(damping=.1)
elif method == 2:
    inf_method = approx_inf.GHKS(damping=.1)
elif method == 3:
    inf_method = approx_inf.EP(power=1, intmethod='GH', damping=.1)
elif method == 4:
    inf_method = approx_inf.EP(power=0.5, intmethod='GH', damping=.1)
elif method == 5:
    inf_method = approx_inf.EP(power=0.01, intmethod='GH', damping=.1)