/** * Minimises a function using Powell's conjugate-direction method. * * @method powell * @memberof ran.algorithms * @param {Function} f Objective function to minimise; accepts a number[] and returns number. * @param {number[]} x0 Initial parameter vector. * @param {Object} [opts] Options. * @param {number} [opts.tol=1e-8] Fractional tolerance on the objective value for convergence. * @param {number} [opts.maxIter=200] Maximum number of outer iterations. * @param {number} [opts.capAbs=Infinity] Absolute ceiling on the convergence threshold. The * fractional test's tolerated absolute gap (`tol * (|fStart| + |fret|)`) grows with the * objective's magnitude, so on an objective that scales with sample size `n` (e.g. -lnL(data)) * the tolerated gap grows with `n` too; capping it keeps convergence n-aware. Defaults to * `Infinity` so every existing caller is unaffected. * @returns {number[]} Parameter vector at the approximate minimum. * @private */ export default function powell(f: Function, x0: number[], opts?: { tol?: number; maxIter?: number; capAbs?: number; }): number[];