derivkit.forecasting.dali module#
DALI forecasting utilities.
- derivkit.forecasting.dali.build_dali(function: Callable[[ArrayLike], floating | ndarray[tuple[Any, ...], dtype[floating]]], theta0: ArrayLike, cov: ArrayLike, *, method: str | None = None, n_workers: int = 1, **dk_kwargs: Any) tuple[ndarray[tuple[Any, ...], dtype[floating]], ndarray[tuple[Any, ...], dtype[floating]]]#
Builds the doublet-DALI tensors (G, H) for the given model.
- Parameters:
function – The scalar or vector-valued function to differentiate. It should accept a list or array of parameter values as input and return either a scalar or a
np.ndarrayof observable values.theta0 – The points at which the derivative is evaluated. A 1D array or list of parameter values matching the expected input of the function.
cov – The covariance matrix of the observables. Should be a square matrix with shape
(n_observables, n_observables), wheren_observablesis the number of observables returned by the function.method – Method name or alias (e.g.,
"adaptive","finite"). IfNone, thederivkit.derivative_kit.DerivativeKitdefault is used.n_workers – Number of workers for per-parameter parallelization/threads. Default
1(serial). Inner batch evaluation is kept serial to avoid oversubscription.dk_kwargs – Additional keyword arguments passed to
derivkit.calculus_kit.CalculusKit.
- Returns:
A tuple
(G, H)whereGhas shape(P, P, P)andHhas shape(P, P, P, P), withPbeing the number of model parameters.