You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior: The samplers converge to best-fit parameters that have the maximum likelihood
Actual behavior: corner plot shows that parameters converge to a group of parameters that do not have the maximum likelihood. Besides, best-fit parameters are not covered by [16%,84%] range of samples.
What have you tried so far?: I saved every group of parameters called by "log_likelihood" and the corresponding likelihood value returned by "log_likelihood" into a new file. I run MCMC sampling for 2000 steps with 12 chains and burned 0 steps. I found that "get_chain" returns 24000 samples while my file only saved less than 20000 samples. The samples returned by "get_chain" do not converge while samples saved by my file show that they are converged. When I was checking the likelihood value I found that samples do not converge to the best-fit parameters that gave the maximum likelihood. I guess the reason is that the best-fit parameters are too close to the boundary of parameter space defined in "log_prior". Therefore MCMC converged to a local minimum instead of the global minimum. To enlarge the parameter space would make it unphysical. What should I do?
Minimal example:
importemcee## I paste my "log_likelihood" here.importnumpyasnpimportosdeflog_likelihood(par, y ,yerr):
p1,p2,p3,p4,p5,p6=parmodel=model(p1,p2,p3,p4,p5,p6)
likelihood=-0.5*np.sum((y-model)**2/yerr**2)
# save parameters called by log_likelihood and likelihood to new filesw= [p1,p2,p3,p4,p5,p6,likelihood]
pid=os.getpid()
f=open(str(pid) +'csv','a')
csv_writer=csv.writer(f,dialect='excel')
csv_writer.writerow(w)
f.close()
returnlikelihood# sample code goes here...
The text was updated successfully, but these errors were encountered:
General information:
Problem description:
Expected behavior: The samplers converge to best-fit parameters that have the maximum likelihood
Actual behavior: corner plot shows that parameters converge to a group of parameters that do not have the maximum likelihood. Besides, best-fit parameters are not covered by [16%,84%] range of samples.
What have you tried so far?: I saved every group of parameters called by "log_likelihood" and the corresponding likelihood value returned by "log_likelihood" into a new file. I run MCMC sampling for 2000 steps with 12 chains and burned 0 steps. I found that "get_chain" returns 24000 samples while my file only saved less than 20000 samples. The samples returned by "get_chain" do not converge while samples saved by my file show that they are converged. When I was checking the likelihood value I found that samples do not converge to the best-fit parameters that gave the maximum likelihood. I guess the reason is that the best-fit parameters are too close to the boundary of parameter space defined in "log_prior". Therefore MCMC converged to a local minimum instead of the global minimum. To enlarge the parameter space would make it unphysical. What should I do?
Minimal example:
The text was updated successfully, but these errors were encountered: