__optimize__

Optimization functions

pynumdiff.optimize.__optimize__.__optimize__(params, args, optimization_method='Nelder-Mead', optimization_options={'maxiter': 20})

Find the optimal parameters for a given differentiation method. This function gets called by optimize.METHOD_FAMILY.METHOD. For example, optimize.smooth_finite_difference.butterdiff will call this function to determine the optimal parameters for butterdiff. This function is a wrapper that parallelizes the __go__ function, which is a wrapper for __objective_function__.

Parameters
  • params (list, list of lists, or None) – Initial guess for params, list of guesses, or None

  • args (list -> (function reference, np.array, float, list, list, list, dict, np.array, float, int, string)) – list of the following: function, x, dt, params_types, params_low, params_high, options, dxdt_truth, tvgamma, padding, metric - function : function to optimize parameters for, i.e. optimize.smooth_finite_difference.butterdiff - x : (np.array of floats, 1xN) time series to differentiate - dt : (float) time step - params_types : (list of types) types for each parameter, i.e. [int, int], or [int, float, float] - params_low : (list) list of lowest allowable values for each parameter - params_high : (list) list of highest allowable values for each parameter - options : (dict) options, see for example finite_difference.first_order - dxdt_truth : (like x) actual time series of the derivative of x, if known - tvgamma : (float) regularization value used to select for parameters that yield a smooth derivative. Larger value results in a smoother derivative - padding : (int) number of time steps to ignore at the beginning and end of the time series in the optimization. Larger value causes the optimization to emphasize the accuracy of dxdt in the middle of the time series - metric : (string) either ‘rmse’ or ‘error_correlation’, only applies if dxdt_truth is not None, see __objective_function__

Returns

a tuple containing: - optimal parameters - optimal values of objective function

Return type

tuple -> (list, float)