diff --git a/README.md b/README.md
index 41e644f..22e1ce7 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,7 @@ For instance, if you wanted to draw samples from a 10-dimensional Rosenbrock dis
import pocomc as pc
import numpy as np
-ndim = 10 # Number of dimensions
+n_dim = 10 # Number of dimensions
def log_prior(x):
if np.any((x < -10.0) | (x > 10.0)): # If any dimension is out of bounds, the log prior is -infinity
@@ -54,11 +54,11 @@ def log_likelihood(x):
+ (x[:,::2] - 1.0)**2.0, axis=1)
-nwalkers = 1000
+n_particles = 1000
prior_samples = np.random.uniform(size=(nwalkers, ndim), low=-10.0, high=10.0)
-sampler = pc.Sampler(nwalkers,
- ndim,
+sampler = pc.Sampler(n_particles,
+ n_dim,
log_likelihood,
log_prior,
vectorize_likelihood=True,
diff --git a/docs/build/doctrees/api/plotting.doctree b/docs/build/doctrees/api/plotting.doctree
index 36709a6..ccbcccb 100644
Binary files a/docs/build/doctrees/api/plotting.doctree and b/docs/build/doctrees/api/plotting.doctree differ
diff --git a/docs/build/doctrees/api/sampler.doctree b/docs/build/doctrees/api/sampler.doctree
index 321d2b6..636f74b 100644
Binary files a/docs/build/doctrees/api/sampler.doctree and b/docs/build/doctrees/api/sampler.doctree differ
diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle
index 7628b4a..b4f571f 100644
Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ
diff --git a/docs/build/doctrees/examples.doctree b/docs/build/doctrees/examples.doctree
index 7fb4e03..7517fab 100644
Binary files a/docs/build/doctrees/examples.doctree and b/docs/build/doctrees/examples.doctree differ
diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree
index 10cedcd..daa22ae 100644
Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ
diff --git a/docs/build/doctrees/pages/quickstart.doctree b/docs/build/doctrees/pages/quickstart.doctree
index f5c3126..c2f7bcd 100644
Binary files a/docs/build/doctrees/pages/quickstart.doctree and b/docs/build/doctrees/pages/quickstart.doctree differ
diff --git a/docs/build/html/_sources/examples.rst.txt b/docs/build/html/_sources/examples.rst.txt
index f0fd7da..706415b 100644
--- a/docs/build/html/_sources/examples.rst.txt
+++ b/docs/build/html/_sources/examples.rst.txt
@@ -5,7 +5,8 @@ Examples
This page highlights several examples on how ``pocomc``
can be used in practice, illustrating both simple and more advanced
aspects of the code. Jupyter notebooks containing more details are available
-`on Github results (dict) – Result dictionary produced using full_run (bool) – Whether or not to include run diagnostics beyond the basic run. Default: full_run (bool) – If True, include run diagnostics beyond the basic run. Default: width (float) – Width of figure. Default: height (float) – Height of each subplot. Default: Corner plot of the 1-D and 2-D marginal posteriors. Corner plot of the 1-D and 2-D marginal posteriors. A Preconditioned Monte Carlo class. Preconditioned Monte Carlo class. nparticles (int) – The total number of particles/walkers to use. ndim (int) – The total number of parameters/dimensions. loglikelihood (callable) – Function returning the log likelihood of a set
+ n_particles (int) – The total number of particles/walkers to use. n_dim (int) – The total number of parameters/dimensions. log_likelihood (callable) – Function returning the log likelihood of a set
of parameters. logprior (callable) – Function returning the log prior of a set
+ log_prior (callable) – Function returning the log prior of a set
of parameters. bounds ( periodic (list) – List of indeces that correspond to parameters with
+ periodic (list) – List of indices that correspond to parameters with
periodic boundary conditions. reflective (list) – List of indeces that correspond to parameters with
+ reflective (list) – List of indices that correspond to parameters with
reflective boundary conditions. threshold (float) – The threshold value for the (normalised) proposal
scale parameter below which normalising flow
@@ -363,29 +361,29 @@ PlottingParameters
@@ -381,9 +381,7 @@ pocoMC
.True
.True
.10.0
.10.0
.Plotting
-
+
diff --git a/docs/build/html/api/sampler.html b/docs/build/html/api/sampler.html
index 2766bc1..804dae5 100644
--- a/docs/build/html/api/sampler.html
+++ b/docs/build/html/api/sampler.html
@@ -334,26 +334,24 @@
Sampler
Sampler#
-
+class pocomc.Sampler(n_particles: int, n_dim: int, log_likelihood: callable, log_prior: callable, bounds: Optional[numpy.ndarray] = None, periodic=None, reflective=None, threshold: float = 1.0, scale: bool = True, rescale: bool = False, diagonal: bool = True, log_likelihood_args: Optional[list] = None, log_likelihood_kwargs: Optional[dict] = None, log_prior_args: Optional[list] = None, log_prior_kwargs: Optional[dict] = None, vectorize_likelihood: bool = False, vectorize_prior: bool = False, infer_vectorization: bool = True, pool=None, parallelize_prior: bool = False, flow_config: Optional[dict] = None, train_config: Optional[dict] = None, random_state: Optional[int] = None)#
+
-
np.ndarray
or None) – Array of shape (ndim, 2)
holding the boundaries
of parameters (default is bounds=None
). If a
parameter is unbounded from below, above or both
please provide None
for the respective boundary.SamplerTrue.
rescale (bool) – Whether to rescale the distribution of particles to
-have zero mean and unit variance in every iterations.
+have zero mean and unit variance in every iteration.
Default is False
.
diagonal (bool) – Use a diagonal covariance matrix when rescaling instead
of a full covariance. Default is True
.
loglikelihood_args (list) – Extra arguments to be passed into the loglikelihood +
log_likelihood_args (list) – Extra arguments to be passed to log_likelihood
(default is loglikelihood_args=None
).
loglikelihood_kwargs (dict) – Extra arguments to be passed into the loglikelihood +
log_likelihood_kwargs (dict) – Extra arguments to be passed to log_likelihood
(default is loglikelihood_kwargs=None
).
logprior_args (list) – Extra arguments to be passed into the logprior
-(default is logprior_args=None
).
logprior_kwargs (list) – Extra arguments to be passed into the logprior
-(default is logprior_kwargs=None
).
vectorize_likelihood (bool) – Whether or not to vectorize the loglikelihood
+
log_prior_args (list) – Extra arguments to be passed to log_prior
+(default is log_prior_args=None
).
log_prior_kwargs (list) – Extra arguments to be passed to log_prior
+(default is log_prior_kwargs=None
).
vectorize_likelihood (bool) – If True, vectorize loglikelihood
calculation (default is vectorize_likelihood=False
).
vectorize_logprior (bool) – Whether or not to vectorize the logprior
+
vectorize_prior (bool) – If True, vectorize log_prior
calculation (default is vectorize_prior=False
).
infer_vectorization (bool) – Whether or not to infer the vectorization status of +
infer_vectorization (bool) – If True, infer the vectorization status of
the loglikelihood and logprior automatically. Default
is True
(overwrites the vectorize_likelihood
and vectorize_prior
arguments).
pool (pool) – Provided MPI
or multiprocessing
pool for
parallelisation (default is pool=None
).
parallelize_prior (bool) – Whether or not to use the pool
(if provided)
+
parallelize_prior (bool) – If True, use the pool
(if provided)
for the logprior
as well (default is
parallelize_prior=False
).
flow_config (dict or None
) – Configuration of the normalizing flow (default is
@@ -398,14 +396,14 @@
Method that generates additional samples at the end of the run
N (int) – The number of additional samples. Default: 1000
.
retrain (bool) – Whether or not to retrain the normalising flow preconditioner between iterations. Default: False
.
progress (bool) – Whether or not to show progress bar. Default: True
.
n (int) – The number of additional samples. Default: 1000
.
retrain (bool) – If True, retrain the normalising flow preconditioner between iterations. Default: False
.
progress (bool) – If True, show progress bar. Default: True
.
Run Preconditioned Monte Carlo.
nmin (int or None) – The minimum number of MCMC steps per iteration (default is nmin = ndim // 2
).
nmax (int or None) – The maximum number of MCMC steps per iteration (default is nmin = int(10 * ndim)
).
progress (bool) – Whether or not to print progress bar (default is progress=True
).
n_min (int or None) – The minimum number of MCMC steps per iteration (default is n_min = ndim // 2
).
n_max (int or None) – The maximum number of MCMC steps per iteration (default is n_min = int(10 * n_dim)
).
progress (bool) – If True, print progress bar (default is progress=True
).
seaborn
+is required to be installed to generate some of the plots.
The Gaussian Shells
are a clear example of a bimodal distribution. Allthough
diff --git a/docs/build/html/index.html b/docs/build/html/index.html
index 49d66ca..ee4b1de 100644
--- a/docs/build/html/index.html
+++ b/docs/build/html/index.html
@@ -437,7 +437,7 @@
0.0.1 (30/04/22)
+0.1.0 (12/07/22)
First version