import MCMC from './_mcmc'; /** * Class implementing coordinate-wise [slice sampling]{@link https://en.wikipedia.org/wiki/Slice_sampling} * (Neal, R.M. (2003) "Slice Sampling", Annals of Statistics 31(3):705-767) via the stepping-out * and shrinkage procedure. Each sweep updates every dimension in turn: a vertical level is drawn * below the current point's density, an interval bracketing the resulting horizontal slice is * found by stepping outward in increments of `w`, and a point within that interval is accepted * once shrinkage finds one whose density exceeds the vertical level. No proposal distribution or * gradient is required, and every sweep produces an accepted draw, so [ar]{@link ran.mc.Slice#ar} * is always 1. * * A prior, non-functional `slice.js` (100% commented out, 1D only, never wired into the base * class) was deleted as dead code in PR #615; this is a fresh implementation, not a restoration. * * @class Slice * @memberof ran.mc * @param {Object} options Sampler options, as a single object. * @param {Function} options.logDensity The logarithm of the (unnormalized) target density. * @param {Object=} options.config Sampler configuration (see MCMC base class for shared options). * @param {Object=} options.initialState Initial state of the sampler (see MCMC base class). The * interval width `w` (default 1.0) may be seeded via `initialState.internal.w`, either as a single * number (broadcast to every dimension) or as a per-dimension array. * @constructor * @throws {Error} If options is not a plain object, or if `w` (or any element of a per-dimension * `w` array) is not a positive, finite number, or if a per-dimension `w` array's length does not * equal `dim`. */ export default class Slice extends MCMC { _w: any[]; _bwSum: any; _adjN: any; _adjBatch: any; _bracketWidths: any[]; /** * @param {Object} options Sampler options, as a single object. * @param {Function} options.logDensity The logarithm of the (unnormalized) target density. * @param {Object=} options.config Sampler configuration (see MCMC base class for shared options). * @param {Object=} options.initialState Initial state of the sampler (see MCMC base class). The * interval width `w` (default 1.0) may be seeded via `initialState.internal.w`, either as a * single number (broadcast to every dimension) or as a per-dimension array. * @throws {Error} If options is not a plain object. */ constructor(options: { logDensity: Function; config?: any | undefined; initialState?: any | undefined; }); _iter(x: any): { x: any; accepted: boolean; bracketWidths: any[]; }; _adjust(i: any): void; _internal(): { w: any[]; bwSum: any; adjN: any; adjBatch: any; }; _stepOut(x1: any, d: any, logY: any): any[]; _shrink(x1: any, d: any, logY: any, bracket: any): any; static _resolveW(w: any, dim: any): any[]; static _validateOptions(options: any): void; static _isPlainObject(options: any): boolean; static _validateW(w: any, dim: any): void; static _isPositiveNumber(w: any): boolean; }