package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `Model
]
type t = [ `Model | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : ?fjacb:Py.Object.t -> ?fjacd:Py.Object.t -> ?extra_args:Py.Object.t -> ?estimate:Py.Object.t -> ?implicit:bool -> ?meta:Py.Object.t -> fcn:Py.Object.t -> unit -> t

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.

Parameters ---------- fcn : function fcn(beta, x) --> y fjacb : function Jacobian of fcn wrt the fit parameters beta.

fjacb(beta, x) --> @f_i(x,B)/@B_j fjacd : function Jacobian of fcn wrt the (possibly multidimensional) input variable.

fjacd(beta, x) --> @f_i(x,B)/@x_j extra_args : tuple, optional If specified, `extra_args` should be a tuple of extra arguments to pass to `fcn`, `fjacb`, and `fjacd`. Each will be called by `apply(fcn, (beta, x) + extra_args)` estimate : array_like of rank-1 Provides estimates of the fit parameters from the data

estimate(data) --> estbeta implicit : boolean If TRUE, specifies that the model is implicit; i.e `fcn(beta, x)` ~= 0 and there is no y data to fit against meta : dict, optional freeform dictionary of metadata for the model

Notes ----- 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 of the callback functions:

`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 `~scipy.odr.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 = d f_l(X,B)/d 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 = d f_l(X,B)/d 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,)`.

val set_meta : ?kwds:(string * Py.Object.t) list -> [> tag ] Obj.t -> Py.Object.t

Update the metadata dictionary with the keywords and data provided here.

Examples -------- set_meta(name='Exponential', equation='y = a exp(b x) + c')

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.