dioph/periodicity

ValueError: Digital filter critical frequencies must be 0 < Wn < 1

masuta16 opened this issue · 1 comments

I'm trying to execute your code below
from periodicity.gp import *
from lightkurve import search_lightcurvefile

lcs = search_lightcurvefile(target=9895037, quarter=[4,5]).download_all()
lc = lcs[0].PDCSAP_FLUX.normalize().append(lcs[1].PDCSAP_FLUX.normalize())
lc = lc.remove_nans().remove_outliers().bin(binsize=4)

t, x = lc.time, lc.flux
x = x - x.mean()

model = FastGPModeler(t, x)
model.prior = make_gaussian_prior(t, x)
model.minimize()
samples = model.mcmc(nwalkers=32, nsteps=5000, burn=500)

print('Median period: {:.2f}'.format(np.exp(np.median(samples[:, 4]))))

And it returns an error

ValueError Traceback (most recent call last)

in ()
10
11 model = FastGPModeler(t, x)
---> 12 model.prior = make_gaussian_prior(t, x)
13 model.minimize()
14 samples = model.mcmc(nwalkers=32, nsteps=5000, burn=500)

dioph commented

Thank you for the issue! Apparently, I updated the README example before releasing the current version where it works in (0.1.0b3).
In order to avoid this error in 0.1.0b2, you should use a larger value for pmin as a parameter to make_gaussian_prior, for example:

model.prior = make_gaussian_prior(t, x, pmin=2)

I hope that helps! My apologies for the current lack of documentation.