-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
increase the number of burn-in steps #65
Changes from 3 commits
b740d5d
c49fb0a
92b6b89
5cad138
7f130f1
202df62
656f6ea
357854c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,6 +181,10 @@ def fit(self, X, B, T, W=None, fix_k=None, fix_p=None): | |
) | ||
result = {'map': res.x} | ||
|
||
# TODO: should not use fixed k/p as search parameters | ||
if fix_k: result['map'][0] = log(fix_k) | ||
if fix_p: result['map'][1] = log(fix_p) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. multiple statements on one line (colon) |
||
|
||
# Let's sample from the posterior to compute uncertainties | ||
if self._ci: | ||
dim, = res.x.shape | ||
|
@@ -194,7 +198,7 @@ def fit(self, X, B, T, W=None, fix_k=None, fix_p=None): | |
mcmc_initial_noise = 1e-3 | ||
p0 = [result['map'] + mcmc_initial_noise * numpy.random.randn(dim) | ||
for i in range(n_walkers)] | ||
n_burnin = 20 | ||
n_burnin = 200 | ||
n_steps = numpy.ceil(1000. / n_walkers) | ||
n_iterations = n_burnin + n_steps | ||
sys.stdout.write('\n') | ||
|
@@ -205,6 +209,8 @@ def fit(self, X, B, T, W=None, fix_k=None, fix_p=None): | |
sys.stdout.write('\n') | ||
result['samples'] = sampler.chain[:, n_burnin:, :] \ | ||
.reshape((-1, dim)).T | ||
if fix_k: result['samples'][0, :] = log(fix_k) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. multiple statements on one line (colon) |
||
if fix_p: result['samples'][1, :] = log(fix_p) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. multiple statements on one line (colon) |
||
|
||
self.params = {k: { | ||
'k': exp(data[0]), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple statements on one line (colon)