Skip to content

Commit

Permalink
both examples mostly working; dont know where phase terms come in
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakaplan committed Nov 17, 2023
1 parent 91ff450 commit e363328
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions docs/examples/MCMC_walkthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
)
phase = 1.0 - maxbin[0] / float(len(template))
print(f"Starting pulse likelihood: {like_start}")
print("Starting pulse phase: {phase}")
print(f"Starting pulse phase: {phase}")
print("Pre-MCMC Values:")
for name, val in zip(fitter.fitkeys, fitter.fitvals):
print("%8s:\t%12.5g" % (name, val))
Expand Down Expand Up @@ -176,11 +176,6 @@ def lnprior_basic(ftr, theta):
lnsum = 0.0
for val, key in zip(theta[:-1], ftr.fitkeys[:-1]):
lnsum += getattr(ftr.model, key).prior_pdf(val, logpdf=True)
# print('%s:\t%f' % (key, val))
# print('PHASE:\t%f' % theta[-1])
# Add phase term
if theta[-1] > 1.0 or theta[-1] < 0.0:
return np.inf
return lnsum


Expand All @@ -199,7 +194,7 @@ def lnlikelihood_chi2(ftr, theta):

# %%
like_start = fitter2.lnlikelihood(fitter2, fitter2.get_parameters())
print("Starting pulse likelihood: %f" % like_start)
print(f"Starting pulse likelihood: {like_start}")

# %%
fitter2.fit_toas(maxiter=nsteps2, pos=None)
Expand Down

0 comments on commit e363328

Please sign in to comment.