import MCMC from './_mcmc'; import { Normal } from '../dist'; /** * Class implementing the full-covariance [adaptive Metropolis]{@link https://projecteuclid.org/euclid.bj/1080222083} * algorithm (Haario, Saksman & Tamminen, 2001). Unlike [RWM]{@link ran.mc.RWM}, which adapts only the per-component * (diagonal) proposal scale, this sampler learns the full joint proposal covariance from the chain's own history * during warm-up: `Sigma_proposal = (2.38^2 / dim) * (Cov(x) + epsilon * I)`. The covariance is refactorized via * `Matrix.ldl()` after every warm-up iteration and frozen once `sample()` is called, since `_adjust` is only ever * invoked from `warmUp()`. * * @class AdaptiveMetropolis * @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 AdaptiveMetropolis 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 AdaptiveMetropolis extends MCMC { _q: Normal; _sd: number; _zBuffer: any[]; _delta: any[]; _delta2: any[]; _A: any; _covN: any; _covMean: any; _covS: 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 AdaptiveMetropolis 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.AdaptiveMetropolis * @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; prngQ: number[]; covN: any; covMean: any; covS: any; }; _updateCovariance(x: any): void; _refreshFactor(): void; _restoreCovarianceAccumulator(): void; static _validateOptions(options: any): void; static _isPlainObject(options: any): boolean; }