55from odrpack .__odrpack import loc_iwork , loc_rwork
66from odrpack .__odrpack import odr as _odr
77from odrpack .__odrpack import workspace_dimensions , stop_message
8- from odrpack .result import BoolArray , F64Array , OdrResult
8+ from odrpack .result import BoolArrayLike , F64Array , F64ArrayLike , OdrResult
99
1010__all__ = ['odr_fit' ]
1111
1212
1313def odr_fit (f : Callable [[F64Array , F64Array ], F64Array ],
14- xdata : F64Array ,
15- ydata : F64Array ,
16- beta0 : F64Array ,
14+ xdata : F64ArrayLike ,
15+ ydata : F64ArrayLike ,
16+ beta0 : F64ArrayLike ,
1717 * ,
18- weight_x : float | F64Array | None = None ,
19- weight_y : float | F64Array | None = None ,
20- bounds : tuple [F64Array | None , F64Array | None ] | None = None ,
18+ weight_x : float | F64ArrayLike | None = None ,
19+ weight_y : float | F64ArrayLike | None = None ,
20+ bounds : tuple [F64ArrayLike | None , F64ArrayLike | None ] | None = None ,
2121 task : Literal ['explicit-ODR' , 'implicit-ODR' , 'OLS' ] = 'explicit-ODR' ,
22- fix_beta : BoolArray | None = None ,
23- fix_x : BoolArray | None = None ,
22+ fix_beta : BoolArrayLike | None = None ,
23+ fix_x : BoolArrayLike | None = None ,
2424 jac_beta : Callable [[F64Array , F64Array ], F64Array ] | None = None ,
2525 jac_x : Callable [[F64Array , F64Array ], F64Array ] | None = None ,
26- delta0 : F64Array | None = None ,
26+ delta0 : F64ArrayLike | None = None ,
2727 diff_scheme : Literal ['forward' , 'central' ] = 'forward' ,
2828 report : Literal ['none' , 'short' , 'long' , 'iteration' ] = 'none' ,
2929 maxit : int = 50 ,
3030 ndigit : int | None = None ,
3131 taufac : float | None = None ,
3232 sstol : float | None = None ,
3333 partol : float | None = None ,
34- step_beta : F64Array | None = None ,
35- step_delta : F64Array | None = None ,
36- scale_beta : F64Array | None = None ,
37- scale_delta : F64Array | None = None ,
34+ step_beta : F64ArrayLike | None = None ,
35+ step_delta : F64ArrayLike | None = None ,
36+ scale_beta : F64ArrayLike | None = None ,
37+ scale_delta : F64ArrayLike | None = None ,
3838 rptfile : str | None = None ,
3939 errfile : str | None = None ,
4040 ) -> OdrResult :
@@ -46,19 +46,19 @@ def odr_fit(f: Callable[[F64Array, F64Array], F64Array],
4646 f : Callable[[F64Array, F64Array], F64Array]
4747 Function to be fitted, with the signature `f(x, beta)`. It must return
4848 an array with the same shape as `y`.
49- xdata : F64Array
49+ xdata : F64ArrayLike
5050 Array of shape `(n,)` or `(m, n)` containing the observed values of the
5151 explanatory variable(s).
52- ydata : F64Array
52+ ydata : F64ArrayLike
5353 Array of shape `(n,)` or `(q, n)` containing the observed values of the
5454 response variable(s). When the model is explicit, `ydata` must contain
5555 a value for each observation. To ignore specific values (e.g., missing
5656 data), set the corresponding entry in `weight_y` to zero. When the model
5757 is implicit, `ydata` is not used (but must be defined).
58- beta0 : F64Array
58+ beta0 : F64ArrayLike
5959 Array of shape `(npar,)` with the initial guesses of the model parameters,
6060 within the optional bounds specified by `bounds`.
61- weight_x : float | F64Array | None
61+ weight_x : float | F64ArrayLike | None
6262 Scalar or array specifying how the errors on `xdata` are to be weighted.
6363 If `weight_x` is a scalar, then it is used for all data points. If
6464 `weight_x` is an array of shape `(n,)` and `m==1`, then `weight_x[i]`
@@ -73,7 +73,7 @@ def odr_fit(f: Callable[[F64Array, F64Array], F64Array],
7373 comprehensive description of the options, refer to page 26 of the
7474 ODRPACK95 guide. By default, `weight_x` is set to one for all `xdata`
7575 points.
76- weight_y : float | F64Array | None
76+ weight_y : float | F64ArrayLike | None
7777 Scalar or array specifying how the errors on `ydata` are to be weighted.
7878 If `weight_y` is a scalar, then it is used for all data points. If
7979 `weight_y` is an array of shape `(n,)` and `q==1`, then `weight_y[i]`
@@ -88,7 +88,7 @@ def odr_fit(f: Callable[[F64Array, F64Array], F64Array],
8888 comprehensive description of the options, refer to page 25 of the
8989 ODRPACK95 guide. By default, `weight_y` is set to one for all `ydata`
9090 points.
91- bounds : tuple[F64Array | None, F64Array | None] | None
91+ bounds : tuple[F64ArrayLike | None, F64ArrayLike | None] | None
9292 Tuple of arrays with the same shape as `beta0`, specifying the lower and
9393 upper bounds of the model parameters. The first array contains the lower
9494 bounds, and the second contains the upper bounds. By default, the bounds
@@ -99,11 +99,11 @@ def odr_fit(f: Callable[[F64Array, F64Array], F64Array],
9999 an orthogonal distance regression problem with an explicit model.
100100 `'implicit-ODR'` handles models defined implicitly. `'OLS'` performs
101101 ordinary least squares fitting.
102- fix_beta : BoolArray | None
102+ fix_beta : BoolArrayLike | None
103103 Array with the same shape as `beta0`, specifying which elements of `beta`
104104 are to be held fixed. `True` means the parameter is fixed; `False` means
105105 it is adjustable. By default, all elements of `beta` are set to `False`.
106- fix_x : BoolArray | None
106+ fix_x : BoolArrayLike | None
107107 Array with the same shape as `xdata`, specifying which elements of `xdata`
108108 are to be held fixed. Alternatively, it can be a rank-1 array of shape
109109 `(m,)` or `(n,)`, in which case it will be broadcast along the other
@@ -122,7 +122,7 @@ def odr_fit(f: Callable[[F64Array, F64Array], F64Array],
122122 signature `jac_x(x, beta)`. It must return an array with shape
123123 `(q, m, n)` or a compatible shape. By default, the Jacobian is approximated
124124 numerically using the finite difference scheme specified by `diff_scheme`.
125- delta0 : F64Array | None
125+ delta0 : F64ArrayLike | None
126126 Array with the same shape as `xdata`, containing the initial guesses of
127127 the errors in the explanatory variable. By default, `delta0` is set to
128128 zero for all elements of `xdata`.
@@ -159,30 +159,30 @@ def odr_fit(f: Callable[[F64Array, F64Array], F64Array],
159159 explicit, the default value is `eps**(2/3)`, and when the model is
160160 implicit, the default value is `eps**(1/3)`, where `eps` is the machine
161161 precision in `float64`.
162- step_beta : F64Array | None
162+ step_beta : F64ArrayLike | None
163163 Array with the same shape as `beta0` containing the _relative_ step
164164 sizes used to compute the finite difference derivatives with respect
165165 to the model parameters. By default, the step size is set internally
166166 based on the value of `ndigit` and the type of finite differences
167167 specified by `diff_scheme`. For additional details, refer to pages 31
168168 and 78 of the ODRPACK95 guide.
169- step_delta : F64Array | None
169+ step_delta : F64ArrayLike | None
170170 Array with the same shape as `xdata`, containing the _relative_ step
171171 sizes used to compute the finite difference derivatives with respect to
172172 the errors in the explanatory variable. Alternatively, it can be a rank-1
173173 array of shape `(m,)` or `(n,)`, in which case it will be broadcast along
174174 the other axis. By default, step size is set internally based on the value
175175 of `ndigit` and the type of finite differences specified by `diff_scheme`.
176176 For additional details, refer to pages 31 and 78 of the ODRPACK95 guide.
177- scale_beta : F64Array | None
177+ scale_beta : F64ArrayLike | None
178178 Array with the same shape as `beta0` containing the scale values of the
179179 model parameters. Scaling is used to improve the numerical stability
180180 of the regression, but does not affect the problem specification. Scaling
181181 should not be confused with the weighting matrices `weight_x` and
182182 `weight_y`. By default, the scale is set internally based on the relative
183183 magnitudes of `beta`. For further details, refer to pages 32 and 84 of
184184 the ODRPACK95 guide.
185- scale_delta : F64Array | None
185+ scale_delta : F64ArrayLike | None
186186 Array with the same shape as `xdata`, containing the scale values of the
187187 errors in the explanatory variable. Alternatively, it can be a rank-1
188188 array of shape `(m,)` or `(n,)`, in which case it will be broadcast along
0 commit comments