From 135cdbf67e4a4e87cf35344f5385d05286a5c70a Mon Sep 17 00:00:00 2001 From: Spencer Hurt Date: Mon, 20 Apr 2020 19:03:24 -0600 Subject: [PATCH 1/3] Fix chain/lnprobability output --- radvel/mcmc.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/radvel/mcmc.py b/radvel/mcmc.py index 78e63213..e3870047 100644 --- a/radvel/mcmc.py +++ b/radvel/mcmc.py @@ -127,7 +127,7 @@ def convergence_check(minAfactor, maxArchange, maxGR, minTz, minsteps, minpercen statevars.ncomplete += sampler.get_log_prob(flat=True).shape[0] statevars.ar += sampler.acceptance_fraction.mean() * 100 statevars.chains.append(sampler.get_chain()[:,:,:].T) - statevars.lnprob.append(sampler.get_log_prob(flat=True)) + statevars.lnprob.append(sampler.get_log_prob().T) statevars.ar /= statevars.ensembles statevars.pcomplete = statevars.ncomplete/float(statevars.totsteps) * 100 @@ -461,11 +461,12 @@ def mcmc(post, nwalkers=50, nrun=10000, ensembles=8, checkinterval=50, minAfacto _closescr() print(msg) - preshaped = np.dstack(statevars.chains) - df = pd.DataFrame( - preshaped.reshape(preshaped.shape[0], preshaped.shape[1]*preshaped.shape[2]).transpose(), - columns=post.list_vary_params()) - df['lnprobability'] = np.hstack(statevars.lnprob) + preshaped_chain = np.dstack(statevars.chains) + df = pd.DataFrame(preshaped_chain.reshape(preshaped_chain.shape[0], + preshaped_chain.shape[1] * preshaped_chain.shape[2]).transpose(), + columns=post.name_vary_params()) + preshaped_ln = np.hstack(statevars.lnprob) + df['lnprobability'] = preshaped_ln.reshape(preshaped_chain.shape[1] * preshaped_chain.shape[2]) df = df.iloc[::thin] statevars.factor = [minAfactor] * len(statevars.autosamples) From 52c479b35fe768d44f9e95050d8d75de06ea7207 Mon Sep 17 00:00:00 2001 From: Spencer Hurt Date: Mon, 20 Apr 2020 19:21:57 -0600 Subject: [PATCH 2/3] Correct column names --- radvel/mcmc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radvel/mcmc.py b/radvel/mcmc.py index e3870047..caac80cb 100644 --- a/radvel/mcmc.py +++ b/radvel/mcmc.py @@ -464,7 +464,7 @@ def mcmc(post, nwalkers=50, nrun=10000, ensembles=8, checkinterval=50, minAfacto preshaped_chain = np.dstack(statevars.chains) df = pd.DataFrame(preshaped_chain.reshape(preshaped_chain.shape[0], preshaped_chain.shape[1] * preshaped_chain.shape[2]).transpose(), - columns=post.name_vary_params()) + columns=post.list_vary_params()) preshaped_ln = np.hstack(statevars.lnprob) df['lnprobability'] = preshaped_ln.reshape(preshaped_chain.shape[1] * preshaped_chain.shape[2]) df = df.iloc[::thin] From eb8865ee8e562da959220f4224c2ea275dbed447 Mon Sep 17 00:00:00 2001 From: BJ Fulton Date: Tue, 21 Apr 2020 11:42:50 -0700 Subject: [PATCH 3/3] update version --- radvel/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radvel/__init__.py b/radvel/__init__.py index 21eb4678..ea94ae4f 100644 --- a/radvel/__init__.py +++ b/radvel/__init__.py @@ -25,7 +25,7 @@ def _custom_warningfmt(msg, *a, **b): __all__ = ['model', 'likelihood', 'posterior', 'mcmc', 'prior', 'utils', 'fitting', 'report', 'cli', 'driver', 'gp'] -__version__ = '1.3.7' +__version__ = '1.3.8' __spec__ = __name__ __package__ = __path__[0]