import MCMC from './_mcmc'; import { Normal } from '../dist'; /** * Class implementing the (random walk) [Metropolis]{@link https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm} * algorithm as a diagonal [adaptive Metropolis]{@link https://projecteuclid.org/euclid.bj/1080222083} sampler. * Proposals are joint (every component perturbed at once) in both warm-up and sampling; during warm-up a single * global step scale is adapted via batch Robbins-Monro toward the optimal acceptance rate (0.44 in one dimension, * 0.234 for higher dimensions) and the per-component scales track the running marginal standard deviations. * * @class RWM * @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 RWM configuration (see MCMC base class for shared options). * @param {Object=} options.initialState Initial state of the sampler (see MCMC base class). * @constructor * @throws {Error} If options is not a plain object. */ export default class RWM extends MCMC { _q: Normal; _target: number; _pAccepted: any; _pN: any; _base: any; _ls: any; _pBatch: 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 RWM configuration (see MCMC base class for shared options). * @param {Object=} options.initialState Initial state of the sampler (see MCMC base class). * @throws {Error} If options is not a plain object. */ constructor(options: { logDensity: Function; config?: any | undefined; initialState?: any | undefined; }); /** * Sets the seed for the sampler's pseudo random number generator, including the internal * proposal distribution's generator. * * @method seed * @memberof ran.mc.RWM * @param {number|string} value The value of the seed, either a number or a string (for the ease of tracking seeds). * @returns {this} Reference to the current sampler. * @ignore */ seed(value: number | string): this; _iter(x: any): { x: any; accepted: boolean; }; _adjust(i: any): void; _internal(): { proposal: any; base: any; ls: any; prngQ: number[]; pAccepted: any; pN: any; pBatch: any; }; _jump(x: any): any; _updateProposal(accepted: any): void; _refreshBase(): void; _restoreAdaptationState(): void; static _validateOptions(options: any): void; static _isPlainObject(options: any): boolean; }