stein_thinning.thinning.thin#
- stein_thinning.thinning.thin(sample: ndarray, gradient: ndarray, n_points: int, standardize: bool = True, preconditioner: str = 'id') ndarray #
Optimally select m points from n > m samples generated from a target distribution of d dimensions.
Parameters#
- sample: np.ndarray
n x d array where each row is a sample point.
- gradient: np.ndarray
n x d array where each row is a gradient of the log target.
- n_points: int
integer specifying the desired number of points.
- standardize: bool
optional logical, either ‘True’ (default) or ‘False’, indicating whether or not to standardise the columns of sample around means using the mean absolute deviation from the mean as the scale.
- preconditioner: str
optional string, either ‘id’ (default), ‘med’, ‘sclmed’, or ‘smpcov’, specifying the preconditioner to be used. Alternatively, a numeric string can be passed as the single length-scale parameter of an isotropic kernel.
Returns#
- np.ndarray
array shaped (m,) containing the row indices in sample (and gradient) of the selected points.