optimize

Functions for optimization and fitting

err_func

MRS.optimize.err_func(params, x, y, func, w=None, func_list=None)

Error function for fitting a function

Parameters:

params : tuple

A tuple with the parameters of func according to their order of input

x : float array

An independent variable.

y : float array

The dependent variable.

func : function

A function with inputs: (x, *params)

w : ndarray

A weighting function. Allows emphasizing certain parts of the original function. Should have the same length as x/y.

func_list : dict

dict of callables, each with it’s own set of indices into the params

Returns:

The marginals of the fit to x/y given the params. :

Site Navigation

Stanford CNI

Table Of Contents

Previous topic

freesurfer

Next topic

qc

This Page