UNPKG

bayesian-changepoint

Version:

Useful Grid algorithm from Material-UI (https://github.com/mui-org/material-ui)

17 lines (16 loc) 508 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class Gamma { logGamma(x) { const tmp = (x - 0.5) * Math.log(x + 4.5) - (x + 4.5); const ser = 1.0 + 76.18009173 / (x + 0) - 86.50532033 / (x + 1) + 24.01409822 / (x + 2) - 1.231739516 / (x + 3) + 0.00120858003 / (x + 4) - 5.36382e-6 / (x + 5); return tmp + Math.log(ser * Math.sqrt(2 * Math.PI)); } } exports.default = Gamma;