Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return gte ? Math.exp(-(xv[index] - minDist) / spread) : val;
});
const initialValues = [0.5, 0.5];
const data = { x: xv, y: yv };
// Default options for the algorithm (from github example)
const options = {
damping: 1.5,
initialValues,
gradientDifference: 10e-2,
maxIterations: 100,
errorTolerance: 10e-3,
};
const { parameterValues } = LM(data, curve, options);
const [a, b] = parameterValues as number[];
return { a, b };
}