package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `ODR
]
type t = [ `ODR | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : ?beta0:Py.Object.t -> ?delta0:Py.Object.t -> ?ifixb:Py.Object.t -> ?ifixx:Py.Object.t -> ?job:Py.Object.t -> ?iprint:Py.Object.t -> ?errfile:Py.Object.t -> ?rptfile:Py.Object.t -> ?ndigit:Py.Object.t -> ?taufac:Py.Object.t -> ?sstol:Py.Object.t -> ?partol:Py.Object.t -> ?maxit:Py.Object.t -> ?stpb:Py.Object.t -> ?stpd:Py.Object.t -> ?sclb:Py.Object.t -> ?scld:Py.Object.t -> ?work:Py.Object.t -> ?iwork:Py.Object.t -> data:Py.Object.t -> model:Py.Object.t -> unit -> t

The ODR class gathers all information and coordinates the running of the main fitting routine.

Members of instances of the ODR class have the same names as the arguments to the initialization routine.

Parameters ---------- data : Data class instance instance of the Data class model : Model class instance instance of the Model class

Other Parameters ---------------- beta0 : array_like of rank-1 a rank-1 sequence of initial parameter values. Optional if model provides an 'estimate' function to estimate these values. delta0 : array_like of floats of rank-1, optional a (double-precision) float array to hold the initial values of the errors in the input variables. Must be same shape as data.x ifixb : array_like of ints of rank-1, optional sequence of integers with the same length as beta0 that determines which parameters are held fixed. A value of 0 fixes the parameter, a value > 0 makes the parameter free. ifixx : array_like of ints with same shape as data.x, optional an array of integers with the same shape as data.x that determines which input observations are treated as fixed. One can use a sequence of length m (the dimensionality of the input observations) to fix some dimensions for all observations. A value of 0 fixes the observation, a value > 0 makes it free. job : int, optional an integer telling ODRPACK what tasks to perform. See p. 31 of the ODRPACK User's Guide if you absolutely must set the value here. Use the method set_job post-initialization for a more readable interface. iprint : int, optional an integer telling ODRPACK what to print. See pp. 33-34 of the ODRPACK User's Guide if you absolutely must set the value here. Use the method set_iprint post-initialization for a more readable interface. errfile : str, optional string with the filename to print ODRPACK errors to. *Do Not Open This File Yourself!* rptfile : str, optional string with the filename to print ODRPACK summaries to. *Do Not Open This File Yourself!* ndigit : int, optional integer specifying the number of reliable digits in the computation of the function. taufac : float, optional float specifying the initial trust region. The default value is 1. The initial trust region is equal to taufac times the length of the first computed Gauss-Newton step. taufac must be less than 1. sstol : float, optional float specifying the tolerance for convergence based on the relative change in the sum-of-squares. The default value is eps**(1/2) where eps is the smallest value such that 1 + eps > 1 for double precision computation on the machine. sstol must be less than 1. partol : float, optional float specifying the tolerance for convergence based on the relative change in the estimated parameters. The default value is eps**(2/3) for explicit models and ``eps**(1/3)`` for implicit models. partol must be less than 1. maxit : int, optional integer specifying the maximum number of iterations to perform. For first runs, maxit is the total number of iterations performed and defaults to 50. For restarts, maxit is the number of additional iterations to perform and defaults to 10. stpb : array_like, optional sequence (``len(stpb) == len(beta0)``) of relative step sizes to compute finite difference derivatives wrt the parameters. stpd : optional array (``stpd.shape == data.x.shape`` or ``stpd.shape == (m,)``) of relative step sizes to compute finite difference derivatives wrt the input variable errors. If stpd is a rank-1 array with length m (the dimensionality of the input variable), then the values are broadcast to all observations. sclb : array_like, optional sequence (``len(stpb) == len(beta0)``) of scaling factors for the parameters. The purpose of these scaling factors are to scale all of the parameters to around unity. Normally appropriate scaling factors are computed if this argument is not specified. Specify them yourself if the automatic procedure goes awry. scld : array_like, optional array (scld.shape == data.x.shape or scld.shape == (m,)) of scaling factors for the *errors* in the input variables. Again, these factors are automatically computed if you do not provide them. If scld.shape == (m,), then the scaling factors are broadcast to all observations. work : ndarray, optional array to hold the double-valued working data for ODRPACK. When restarting, takes the value of self.output.work. iwork : ndarray, optional array to hold the integer-valued working data for ODRPACK. When restarting, takes the value of self.output.iwork.

Attributes ---------- data : Data The data for this fit model : Model The model used in fit output : Output An instance if the Output class containing all of the returned data from an invocation of ODR.run() or ODR.restart()

val restart : ?iter:int -> [> tag ] Obj.t -> Py.Object.t

Restarts the run with iter more iterations.

Parameters ---------- iter : int, optional ODRPACK's default for the number of new iterations is 10.

Returns ------- output : Output instance This object is also assigned to the attribute .output .

val run : [> tag ] Obj.t -> Py.Object.t

Run the fitting routine with all of the information given and with ``full_output=1``.

Returns ------- output : Output instance This object is also assigned to the attribute .output .

val set_iprint : ?init:Py.Object.t -> ?so_init:Py.Object.t -> ?iter:Py.Object.t -> ?so_iter:Py.Object.t -> ?iter_step:Py.Object.t -> ?final:Py.Object.t -> ?so_final:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Set the iprint parameter for the printing of computation reports.

If any of the arguments are specified here, then they are set in the iprint member. If iprint is not set manually or with this method, then ODRPACK defaults to no printing. If no filename is specified with the member rptfile, then ODRPACK prints to stdout. One can tell ODRPACK to print to stdout in addition to the specified filename by setting the so_* arguments to this function, but one cannot specify to print to stdout but not a file since one can do that by not specifying a rptfile filename.

There are three reports: initialization, iteration, and final reports. They are represented by the arguments init, iter, and final respectively. The permissible values are 0, 1, and 2 representing 'no report', 'short report', and 'long report' respectively.

The argument iter_step (0 <= iter_step <= 9) specifies how often to make the iteration report; the report will be made for every iter_step'th iteration starting with iteration one. If iter_step == 0, then no iteration report is made, regardless of the other arguments.

If the rptfile is None, then any so_* arguments supplied will raise an exception.

val set_job : ?fit_type:[ `One | `PyObject of Py.Object.t ] -> ?deriv:[ `One | `Two | `PyObject of Py.Object.t ] -> ?var_calc:[ `One | `PyObject of Py.Object.t ] -> ?del_init:Py.Object.t -> ?restart:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Sets the 'job' parameter is a hopefully comprehensible way.

If an argument is not specified, then the value is left as is. The default value from class initialization is for all of these options set to 0.

Parameters ---------- fit_type :

, 1, 2

int 0 -> explicit ODR

1 -> implicit ODR

2 -> ordinary least-squares deriv :

, 1, 2, 3

int 0 -> forward finite differences

1 -> central finite differences

2 -> user-supplied derivatives (Jacobians) with results checked by ODRPACK

3 -> user-supplied derivatives, no checking var_calc :

, 1, 2

int 0 -> calculate asymptotic covariance matrix and fit parameter uncertainties (V_B, s_B) using derivatives recomputed at the final solution

1 -> calculate V_B and s_B using derivatives from last iteration

2 -> do not calculate V_B and s_B del_init :

, 1

int 0 -> initial input variable offsets set to 0

1 -> initial offsets provided by user in variable 'work' restart :

, 1

int 0 -> fit is not a restart

1 -> fit is a restart

Notes ----- The permissible values are different from those given on pg. 31 of the ODRPACK User's Guide only in that one cannot specify numbers greater than the last value for each variable.

If one does not supply functions to compute the Jacobians, the fitting procedure will change deriv to 0, finite differences, as a default. To initialize the input variable offsets by yourself, set del_init to 1 and put the offsets into the 'work' variable correctly.

val data : t -> Py.Object.t

Attribute data: get value or raise Not_found if None.

val data_opt : t -> Py.Object.t option

Attribute data: get value as an option.

val model : t -> Py.Object.t

Attribute model: get value or raise Not_found if None.

val model_opt : t -> Py.Object.t option

Attribute model: get value as an option.

val output : t -> Py.Object.t

Attribute output: get value or raise Not_found if None.

val output_opt : t -> Py.Object.t option

Attribute output: get value as an option.

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.