The Model class stores information about the function you wish to fit.
It stores the function itself, at the least, and optionally stores functions which compute the Jacobians used during fitting. Also, one can provide a function that will provide reasonable starting values for the fit parameters possibly given the set of data.
fcn : function
fjacb : function
fjacd : function
extra_args : tuple, optional
estimate : array_like of rank-1
implicit : boolean
meta : dict, optional
Note that the fcn, fjacb, and fjacd operate on NumPy arrays and return a NumPy array. The estimate object takes an instance of the Data class.
Here are the rules for the shapes of the argument and return arrays :
- x – if the input data is single-dimensional, then x is rank-1
- array; i.e. x = array([1, 2, 3, ...]); x.shape = (n,) If the input data is multi-dimensional, then x is a rank-2 array; i.e., x = array([[1, 2, ...], [2, 4, ...]]); x.shape = (m, n) In all cases, it has the same shape as the input data array passed to odr(). m is the dimensionality of the input data, n is the number of observations.
- y – if the response variable is single-dimensional, then y is a
- rank-1 array, i.e., y = array([2, 4, ...]); y.shape = (n,) If the response variable is multi-dimensional, then y is a rank-2 array, i.e., y = array([[2, 4, ...], [3, 6, ...]]); y.shape = (q, n) where q is the dimensionality of the response variable.
- beta – rank-1 array of length p where p is the number of parameters;
- i.e. beta = array([B_1, B_2, ..., B_p])
- fjacb – if the response variable is multi-dimensional, then the
- return array’s shape is (q, p, n) such that fjacb(x,beta)[l,k,i] = @f_l(X,B)/@B_k evaluated at the i’th data point. If q == 1, then the return array is only rank-2 and with shape (p, n).
- fjacd – as with fjacb, only the return array’s shape is (q, m, n)
- such that fjacd(x,beta)[l,j,i] = @f_l(X,B)/@X_j at the i’th data point. If q == 1, then the return array’s shape is (m, n). If m == 1, the shape is (q, n). If m == q == 1, the shape is (n,).
|set_meta(**kwds)||Update the metadata dictionary with the keywords and data provided here.|