/** * Construct a uniform transition matrix over `nStates`. * `transition[i][j] = 1 / nStates`. * * @param {number} nStates - Number of states (positive integer). * @returns {number[][]} Row-stochastic transition matrix. */ export function transition_uniform(nStates: number): number[][]; /** * Construct a self-loop transition matrix. * `transition[i][i] = p`, `transition[i][j] = (1 - p) / (nStates - 1)` for * `j != i`. * * @param {number} nStates - Number of states (> 1). * @param {number|number[]|Float64Array} prob - Self-transition probability, * scalar or per-state vector. Each value must lie in [0, 1]. * @returns {number[][]} Row-stochastic transition matrix. */ export function transition_loop(nStates: number, prob: number | number[] | Float64Array): number[][]; /** * Construct a cyclic transition matrix. * `transition[i][i] = p`, `transition[i][(i + 1) mod nStates] = 1 - p`. * * NOTE: `prob` is the SELF-transition (stay) probability — * e.g. `transition_cycle(4, 0.9)` has 0.9 on the diagonal and 0.1 one step * forward. (The prior pleco implementation had this inverted.) * * @param {number} nStates - Number of states (> 1). * @param {number|number[]|Float64Array} prob - Self-transition probability, * scalar or per-state vector. Each value must lie in [0, 1]. * @returns {number[][]} Row-stochastic transition matrix. */ export function transition_cycle(nStates: number, prob: number | number[] | Float64Array): number[][]; /** * Construct a localized transition matrix. * State `i` transitions only to nearby states, weighted by `window` over a band * of `width`. Off-band entries are zero (unless `wrap` extends locality modulo * `nStates`), and each row is normalized to sum to 1. * * @param {number} nStates - Number of states (> 1). * @param {number|number[]|Int32Array} width - Local band width, scalar or * per-state vector. Each value must be >= 1. * @param {string} [window='triangle'] - Window shape ('triangle' or 'ones'). * @param {boolean} [wrap=false] - Compute locality modulo nStates when true. * @returns {number[][]} Row-stochastic transition matrix. */ export function transition_local(nStates: number, width: number | number[] | Int32Array, window?: string, wrap?: boolean): number[][];