Distance functions or metrics measure closeness of observed and sampled data.
This module implements various commonly used distance functions for ABC,
featuring a few advanced concepts.
For custom distance functions, either pass a plain function to ABCSMC, or
subclass the pyabc.Distance class.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Adapt the weights of AggregatedDistances automatically over time.
Parameters:
distances – As in AggregatedDistance.
initial_weights – Weights to be used in the initial iteration. List with
a weight for each distance function.
factors – As in AggregatedDistance.
adaptive – True: Adapt weights after each iteration.
False: Adapt weights only once at the beginning in initialize().
This corresponds to a pre-calibration.
scale_function – Function that takes a np.ndarray of shape (n_sample,),
namely the values obtained by applying one of the distances on a set
of samples, and returns a single float, namely the weight to apply to
this distance function. Default: span.
log_file – A log file to store weights for each time point in. Weights are
currently not stored in the database. The data are saved in json
format and can be retrieved via pyabc.storage.load_dict_from_json.
distances (List) – The distance functions to apply.
weights (Union[List, dict], optional (default = [1,...])) – The weights to apply to the distances when taking the sum. Can be
a list with entries in the same order as the distances, or a
dictionary of lists, with the keys being the single time points
(if the weights should be iteration-specific).
factors (Union[List, dict], optional (dfault = [1,...])) – Scaling factors that the weights are multiplied with. The same
structure applies as to weights.
If None is passed, a factor of 1 is considered for every summary
statistic.
Note that in this class, factors are superfluous as everything can
be achieved with weights alone, however in subclasses the factors
can remain static while weights adapt over time, allowing for
greater flexibility.
Make the sampler return also rejected particles,
because these are needed to get a better estimate of the summary
statistic variability, avoiding a bias to accepted ones only.
In the p-norm distance, adapt the weights for each generation, based on
the previous simulations. This class is motivated by [1].
Parameters:
p – p for p-norm. Required p >= 1, p = np.inf allowed (infinity-norm).
initial_scale_weights – Scale weights to be used in the initial iteration. Dictionary with
observables as keys and weights as values.
fixed_weights – Fixed multiplicative factors the weights are multiplied with, to
e.g. account for heterogeneous numbers of data points.
The discrimination of various weight types makes only sense for
adaptive distances.
fit_scale_ixs – Generation indices before which to (re)fit the scale weights.
Inf (default) means in every generation. For other values see
pyabc.EventIxs.
scale_function – (data: list, x_0: float) -> scale: float. Computes the scale (i.e.
inverse weight s = 1 / w) for a given summary statistic. Here, data
denotes the list of simulated summary statistics, and x_0 the observed
summary statistic. Implemented are absolute_median_deviation,
standard_deviation (default), centered_absolute_median_deviation,
centered_standard_deviation.
max_scale_weight_ratio – If not None, extreme scale weights will be bounded by the ratio times
the smallest non-zero absolute scale weight.
In practice usually not necessary, it is theoretically required to
ensure convergence if weights are refitted in infinitely many
iterations.
scale_log_file – A log file to store scale weights for each time point in. Weights are
currently not stored in the database. The data are saved in json
format and can be retrieved via pyabc.storage.load_dict_from_json.
all_particles_for_scale – Whether to include also rejected particles for scale calculation
(True) or only accepted ones (False).
sumstat – Summary statistics. Defaults to an identity mapping.
Make the sampler return also rejected particles,
because these are needed to get a better estimate of the summary
statistic variability, avoiding a bias to accepted ones only.
Similar to initialize, however called for every subsequent iteration.
The default is to do nothing.
Parameters:
t – Time point for which to update the distance.
get_sample – Returns on demand the last generation’s complete sample.
total_sims – The total number of simulations so far.
Returns:
is_updated – Whether the distance has changed compared to beforehand.
Depending on the result, the population needs to be updated
in ABCSMC before preparing the next generation.
Defaults to False.
Aggregates a list of distance functions, all of which may work on subparts
of the summary statistics. Then computes and returns the weighted sum of
the distance values generated by the various distance functions.
All class functions are propagated to the children and the obtained
results aggregated appropriately.
distances (List) – The distance functions to apply.
weights (Union[List, dict], optional (default = [1,...])) – The weights to apply to the distances when taking the sum. Can be
a list with entries in the same order as the distances, or a
dictionary of lists, with the keys being the single time points
(if the weights should be iteration-specific).
factors (Union[List, dict], optional (dfault = [1,...])) – Scaling factors that the weights are multiplied with. The same
structure applies as to weights.
If None is passed, a factor of 1 is considered for every summary
statistic.
Note that in this class, factors are superfluous as everything can
be achieved with weights alone, however in subclasses the factors
can remain static while weights adapt over time, allowing for
greater flexibility.
The sum_stats are passed on to all distance functions, each of
which may then update using these. If any update occurred, a value
of True is returned indicating that e.g. the distance may need to
be recalculated since the underlying distances changed.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
This method is called by the inference routine at the beginning.
A possible configuration would be to request also the storing of
rejected particles.
The default is to do nothing.
Similar to initialize, however called for every subsequent iteration.
The default is to do nothing.
Parameters:
t – Time point for which to update the distance.
get_sample – Returns on demand the last generation’s complete sample.
total_sims – The total number of simulations so far.
Returns:
is_updated – Whether the distance has changed compared to beforehand.
Depending on the result, the population needs to be updated
in ABCSMC before preparing the next generation.
Defaults to False.
This is a wrapper around a simple function which calculates the distance.
If a function/callable is passed to the ABCSMC class, which is not
subclassed from pyabc.Distance, then it is converted to an instance of the
SimpleFunctionDistance class.
Parameters:
fun (Callable[[dict, dict], float]) – A Callable accepting as parameters (a subset of) the arguments of the
pyabc.Distance.__call__ function. Usually at least the summary
statistics x and x_0. Returns the distance between both.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
This kernel can be used for efficient computations of large-scale
independent Laplace distributions, performing computations directly
on a log-scale to avoid numeric issues. In each coordinate, a 1-dim
Laplace distribution
\[p(x) = \frac{1}{2b}\exp (\frac{1}{b}|x-a|)\]
is assumed.
Parameters:
scale (Union[array_like, float, Callable], optional (default = ones vector)) – Scale terms b of the distribution. Can also be a Callable taking as
arguments the parameters. In that case, pdf_max should also be given
if it is supposed to be used. Usually, it will then be given as the
density at the observed statistics assuming the minimum allowed
variance.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
This kernel can be used for efficient computations of large-scale
independent normal distributions, circumventing the covariance
matrix, and performing computations directly on a log-scale to avoid
numeric issues.
Parameters:
var (Union[array_like, float, Callable], optional (default = ones vector)) – Variances of the distribution (assuming zeros in the off-diagonal
of the covariance matrix). Can also be a Callable taking as
arguments the parameters. In that case, pdf_max should also be given
if it is supposed to be used. Usually, it will then be given as the
density at the observed statistics assuming the minimum allowed
variance.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
predictor – Predictor model used to quantify the information in data on
parameters.
initial_info_weights – Initial information weights. Can be passed to avoid
(re)-calibration.
fit_info_ixs – Generations when to fit the information weights, similar to
fit_scale_ixs.
Defaults to {9, 15}, which may not always be the smartest choice
and may change in the future.
In particular, consider making it dependent on the total number of
simulations.
normalize_by_par – Whether to normalize total sensitivities of each parameter to 1.
max_info_weight_ratio – Maximum ratio on information weights, similar to
max_scale_weight_ratio.
info_log_file – Log file for the information weights.
info_sample_log_file – Log file for samples used to train the regression model underlying
the information weights, in npy format.
Should be only a base file name, will be automatically postfixed
by “{t}_{var}.npy”, with var in samples, parameters, weights.
fd_deltas – Finite difference step sizes. Can be a float, or a List of floats,
in which case component-wise step size selection is employed.
subsetter – Sample subset/cluster selection method. Defaults to just taking all
samples. In the presence of e.g. multi-modalities it may make sense
to reduce.
all_particles_for_scale – Whether to use all particles for scale calculation (True) or only
accepted ones (False).
all_particles_for_prediction – Whether to include rejected particles for fitting predictor models.
The same arguments apply as for PredictorSumstat.all_particles,
i.e. not using all may yield a better local approximation.
feature_normalization – What normalization to apply to the parameters before predictor
model fitting. Can be any of “std” (standard deviation), “mad”
(median absolute deviation), “weights” (use the inverse scale
weights), or “none” (no normalization). It is recommended to
match this with the scale_function, e.g. std or mad. Allowing
to specify different normalizations (and not “weights”) allows
to e.g. employ outlier down-weighting in the scale function,
and just normalize differently here, in order to not counteract
that.
par_trafo – Parameter transformations to use as targets. Defaults to identity.
Make the sampler return also rejected particles,
because these are needed to get a better estimate of the summary
statistic variability, avoiding a bias to accepted ones only.
Similar to initialize, however called for every subsequent iteration.
The default is to do nothing.
Parameters:
t – Time point for which to update the distance.
get_sample – Returns on demand the last generation’s complete sample.
total_sims – The total number of simulations so far.
Returns:
is_updated – Whether the distance has changed compared to beforehand.
Depending on the result, the population needs to be updated
in ABCSMC before preparing the next generation.
Defaults to False.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Implements a kind of null object as distance function.
This can be used as a dummy distance function if e.g. integrated modeling
is used.
Note
This distance function cannot be evaluated, so currently it is in
particular not possible to use an epsilon threshold which requires
initialization, because during initialization the distance function is
invoked directly and not via the acceptor as usual. Conceptually, this
would be possible and can be implemented on request.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
A kernel with a normal, i.e. Gaussian, probability density.
This is just a wrapper around sp.multivariate_normal.
Parameters:
cov (array_like, optional (default = identiy matrix)) – Covariance matrix of the distribution.
ret_scale (As in StochasticKernel.)
keys (As in StochasticKernel.)
pdf_max (As in StochasticKernel.)
Note
The order of the entries in the mean and cov vectors is assumed
to be the same as the one in keys. If keys is None, it is assumed to
be the same as the one obtained via sorted(x.keys()) for summary
statistics x.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
E.g.
* p=1 for a Manhattan or L1 metric,
* p=2 for a Euclidean or L2 metric,
* p=np.inf for a Chebyshev, maximum or inf metric.
Parameters:
p – p for p-norm. p >= 1, p = np.inf implies max norm.
fixed_weights – Weights.
Dictionary indexed by time points, or only one entry if
the weights should not change over time.
Each entry contains a dictionary of numeric weights, indexed by summary
statistics labels, or the corresponding array representation.
If None is passed, a weight of 1 is considered for every summary
statistic.
If no entry is available for a given time point, the maximum available
time point is selected.
sumstat – Summary statistics transformation to apply to the model output.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
This method is called by the inference routine at the beginning.
A possible configuration would be to request also the storing of
rejected particles.
The default is to do nothing.
Similar to initialize, however called for every subsequent iteration.
The default is to do nothing.
Parameters:
t – Time point for which to update the distance.
get_sample – Returns on demand the last generation’s complete sample.
total_sims – The total number of simulations so far.
Returns:
is_updated – Whether the distance has changed compared to beforehand.
Depending on the result, the population needs to be updated
in ABCSMC before preparing the next generation.
Defaults to False.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Sliced Wasserstein distance via efficient one-dimensional projections.
As the optimal transport mapping underlying Wasserstein distances can be
challenging for high-dimensional problems, this distance reduces
multi-dimensional distributions to one-dimensional representations via
linear projections, and then averages 1d Wasserstein distances, which
can be efficiently calculated by sorting,
across the projected distributions.
More explicitly, with
\(\mathbb{S}^{d-1} = \{u\in\mathbb{R}^d: \|x\|_2=1\}\) denoting the
d-dimensional unit sphere and for \(u\in\mathbb{S}^{d-1}\) denoting by
\(u^*(y) = \langle u, y\rangle\) the associated linear form, the
Sliced Wasserstein distance of order \(p\) between probability measures
\(\mu,\nu\) is defined as:
Here, \(u^*_\# \mu\) denotes the push-forward measure of \(\mu\)
by the projection \(u\), and \(W_p\) the 1d Wasserstein distance
with exponent \(p\) for an underlying distance metric.
In practice, the integral is approximated via a Monte-Carlo sample.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Similar to initialize, however called for every subsequent iteration.
The default is to do nothing.
Parameters:
t – Time point for which to update the distance.
get_sample – Returns on demand the last generation’s complete sample.
total_sims – The total number of simulations so far.
Returns:
is_updated – Whether the distance has changed compared to beforehand.
Depending on the result, the population needs to be updated
in ABCSMC before preparing the next generation.
Defaults to False.
A stochastic kernel assesses the similarity between observed and
simulated summary statistics or data via a probability measure.
Note
The returned value cannot be interpreted as a distance function,
but rather as an inverse distance, as it increases as the similarity
between observed and simulated summary statistics increases.
Thus, a StochasticKernel should only be used together with a
StochasticAcceptor.
Parameters:
ret_scale (str, optional (default = SCALE_LIN)) – The scale of the value returned in __call__:
Given a proability density p(x,x_0), the returned value
can be either of p(x,x_0), or log(p(x,x_0)).
keys (List[str], optional) – The keys of the summary statistics, specifying the order to be used.
pdf_max (float, optional) – The maximum possible probability density function value.
Defaults to None and is then computed as the density at (x_0, x_0),
where x_0 denotes the observed summary statistics.
Must be overridden if pdf_max is to be used in the analysis by the
acceptor and the default is not applicable.
This value should be in the scale specified by ret_scale already.
Optimal transport Wasserstein distance between empirical distributions.
The Wasserstein distance, also referred to as Vaserstein,
Kantorovich-Rubinstein, or earth mover’s distance,
is a metric between probability distributions on a given metric space
(M, d).
Intuitively, it quantifies the minimum cost of transforming one probability
distribution on M into another, with point-wise cost function d.
The Wasserstein distance between discrete distributions
\(\mu = \{(x_i,a_i)\}\) and \(\nu = \{(y_i,b_i)\}\) can be
expressed as
where \(M\in\mathbb{R}^{m\times n}\) is the pairwise cost matrix
defining the cost to move mass from bin \(x_i\)
to bin \(y_j\),
e.g. expressed via a distance metric, \(M_{ij} = \|x_i - y_j\|_p\),
and \(a\) and \(b\) are histograms weighting samples
(e.g. uniform).
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.
Similar to initialize, however called for every subsequent iteration.
The default is to do nothing.
Parameters:
t – Time point for which to update the distance.
get_sample – Returns on demand the last generation’s complete sample.
total_sims – The total number of simulations so far.
Returns:
is_updated – Whether the distance has changed compared to beforehand.
Depending on the result, the population needs to be updated
in ABCSMC before preparing the next generation.
Defaults to False.
Evaluate at time point t the distance of the summary statistics of
the data simulated for the tentatively sampled particle to those of
the observed data.
Abstract method. This method has to be overwritten by
all concrete implementations.
Parameters:
x (dict) – Summary statistics of the data simulated for the tentatively
sampled parameter.
x_0 (dict) – Summary statistics of the observed data.
t (int) – Time point at which to evaluate the distance.
Usually, the distance will not depend on the time.
par (dict) – The parameters used to create the summary statistics x. These
can be required by some distance functions.
Usually, the distance will not depend on the parameters.
Returns:
distance – Quantifies the distance between the summary statistics of the
data simulated for the tentatively sampled particle and of the
observed data.