Skip to content

src/core/fitRunner.js ​

text
Drives MiniNest in small slices so the host (worker or main thread) can
report progress and react to a stop request.

spec.sampler = { nlive (400), fracRemain (0.01), seed (42),
                 maxCalls (1e6): budget of likelihood calls; the run stops cleanly when it is used up,
                 maxSeconds (none): wall-clock budget,
                 method ('auto' | 'region' | 'slice'), sliceSteps }
A run that ends on a budget or on a stop request still returns a usable weighted posterior:
res.converged is false, res.stopReason says why ('max calls reached', 'time limit reached',
'stopped by user'), res.budget has the numbers and res.warnings says it in words.
onProgress receives MiniNest.progress() (it, ncalls, logZ, remFrac, eff, mode, bestL, best, live,
maxCalls, callsFrac, maxSeconds, nclusters) plus elapsed [s] and keys.

Import: import { … } from './src/core/fitRunner.js' — no DOM, runs in Node and the browser.

runFit ​

js
function async runFit(spec, onProgress, shouldStop)

No description in the source.

MIT licensed · Kyle A. Pearson