build/modelscript.umd.js
function step$1(
              data,
              params,
              damping,
              gradientDifference,
              parameterizedFunction
            ) {
              var identity = require$$0$2.Matrix.eye(params.length).mul(
                damping * gradientDifference * gradientDifference
              );

              var l = data.x.length;
              var evaluatedData = new Array(l);
              const func = parameterizedFunction(params);
              for (var i = 0; i < l; i++) {
                evaluatedData[i] = func(data.x[i]);
              }
              var gradientFunc = gradientFunction(
                data,
                evaluatedData,
                params,
                gradientDifference,
                parameterizedFunction
              );
              var matrixFunc = matrixFunction(data, evaluatedData).transposeView();
              var inverseMatrix = require$$0$2.inverse(
                identity.add(gradientFunc.mmul(gradientFunc.transposeView()))
              );
              params = new require$$0$2.Matrix([params]);
              params = params.sub(
                inverseMatrix
                  .mmul(gradientFunc)
                  .mmul(matrixFunc)
                  .mul(gradientDifference)
                  .transposeView()
              );

              return params.to1DArray();
            }
function step$1(
              data,
              params,
              damping,
              gradientDifference,
              parameterizedFunction
            ) {
              var identity = require$$0$2.Matrix.eye(params.length).mul(
                damping * gradientDifference * gradientDifference
              );

              var l = data.x.length;
              var evaluatedData = new Array(l);
              const func = parameterizedFunction(params);
              for (var i = 0; i < l; i++) {
                evaluatedData[i] = func(data.x[i]);
              }
              var gradientFunc = gradientFunction(
                data,
                evaluatedData,
                params,
                gradientDifference,
                parameterizedFunction
              );
              var matrixFunc = matrixFunction(data, evaluatedData).transposeView();
              var inverseMatrix = require$$0$2.inverse(
                identity.add(gradientFunc.mmul(gradientFunc.transposeView()))
              );
              params = new require$$0$2.Matrix([params]);
              params = params.sub(
                inverseMatrix
                  .mmul(gradientFunc)
                  .mmul(matrixFunc)
                  .mul(gradientDifference)
                  .transposeView()
              );

              return params.to1DArray();
            }
function step$1 ( data , params , damping , gradientDifference , parameterizedFunction ) { var identity = require$$0$2 . Matrix . eye ( params . length ) . mul ( damping * gradientDifference * gradientDifference ) ; var l = data . x . length ; var evaluatedData = new Array ( l ) ; const func = parameterizedFunction ( params ) ; for ( var i = 0 ; i < l ; i ++ ) { evaluatedData [ i ] = func ( data . x [ i ] ) ; } var gradientFunc = gradientFunction ( data , evaluatedData , params , gradientDifference , parameterizedFunction ) ; var matrixFunc = matrixFunction ( data , evaluatedData ) . transposeView ( ) ; var inverseMatrix = require$$0$2 . inverse ( identity . add ( gradientFunc . mmul ( gradientFunc . transposeView ( ) ) ) ) ; params = new require$$0$2 . Matrix ( [ params ] ) ; params = params . sub ( inverseMatrix . mmul ( gradientFunc ) . mmul ( matrixFunc ) . mul ( gradientDifference ) . transposeView ( ) ) ; return params . to1DArray ( ) ; }
Iteration for Levenberg-Marquardt
@ignore
@param {{x:Array<number>, y:Array<number>}} data - Array of points to fit in the format [x1, x2, ... ], [y1, y2, ... ]
@param {Array<number>} params - Array of previous parameter values
@param {number} damping - Levenberg-Marquardt parameter
@param {number} gradientDifference - Adjustment for decrease the damping parameter
@param {function} parameterizedFunction - The parameters and returns a function with the independent variable as a parameter
@return {Array<number>}
Iteration for Levenberg - Marquardt