sciope.inference package

Submodules

sciope.inference.abc_inference module

Approximate Bayesian Computation

class sciope.inference.abc_inference.ABC(data, sim, prior_function, epsilon=0.1, summaries_function=<sciope.utilities.summarystats.burstiness.Burstiness object>, distance_function=<sciope.utilities.distancefunctions.euclidean.EuclideanDistance object>, summaries_divisor=None, use_logger=False)[source]

Bases: sciope.inference.inference_base.InferenceBase

Approximate Bayesian Computation Rejection Sampler

Properties/variables: * data (observed / fixed data) * sim (simulator function handle) * prior_function (prior over the simulator parameters) * epsilon (acceptance tolerance bound) * summaries_function (summary statistics calculation function) * distance_function (function calculating deviation between simulated statistics and observed statistics) * summaries_divisor (numpy array of maxima - used for normalizing summary statistic values) * use_logger (whether logging is enabled or disabled)

Methods: * infer (perform parameter inference)

compute_fixed_mean(chunk_size)[source]

Computes the mean over summary statistics on fixed data

chunk_sizeint

the partition size when splitting the fixed data. For avoiding many individual tasks in dask if the data is large

ndarray

scaled distance

infer(num_samples, batch_size, chunk_size=10, ensemble_size=1, normalize=True)[source]

Wrapper for rejection sampling. Performs ABC rejection sampling

num_samplesint

The number of required accepted samples

batch_sizeint

The batch size of samples for performing rejection sampling

chunk_sizeint

The partition size when splitting the fixed data. For avoiding many individual tasks in dask if the data is large. Default 10.

ensemble_sizeint

In case we have an ensemble of responses

normalizebool

Whether summary statistics should be normalized and epsilon be interpreted as a percentage

dict

Keys ‘accepted_samples: The accepted parameter values’, ‘distances: Accepted distance values’, ‘accepted_count: Number of accepted samples’, ‘trial_count: The number of total trials performed in order to converge’, ‘inferred_parameters’: The mean of accepted parameter samples

rejection_sampling(num_samples, batch_size, chunk_size, ensemble_size, normalize)[source]

Perform ABC inference according to initialized configuration.

num_samplesint

The number of required accepted samples

batch_sizeint

The batch size of samples for performing rejection sampling

chunk_sizeint

the partition size when splitting the fixed data. For avoiding many individual tasks in dask if the data is large.

dict

Keys ‘accepted_samples: The accepted parameter values’, ‘distances: Accepted distance values’, ‘accepted_count: Number of accepted samples’, ‘trial_count: The number of total trials performed in order to converge’, ‘inferred_parameters’: The mean of accepted parameter samples

scale_distance(dist)[source]

Performs scaling in [0,1] of a given distance vector/value with respect to historical distances

distndarray, float

distance

ndarray

scaled distance

sciope.inference.bandits_abc module

sciope.inference.inference_base module

Parameter Inference Base Class

class sciope.inference.inference_base.InferenceBase(name, data, sim, use_logger=False)[source]

Bases: object

Base class for parameter inference algorithms. Must not be used directly! Each inference algorithm must implement the methods described herein:

  • InferenceBase.infer()

abstract infer()[source]

Sub-classable method for performing parameter inference. Each derived class must implement.

Module contents