pyesmda.ls_cost_function#
- pyesmda.ls_cost_function(pred: ndarray[tuple[Any, ...], dtype[float64]], obs: ndarray[tuple[Any, ...], dtype[float64]], cov_obs: CovarianceMatrix) ndarray[tuple[Any, ...], dtype[float64]][source]#
Compute the normalized objective function for a given member \(j\).
\[O_{N_{d}, j} = \frac{1}{2N_{d}} \sum_{j=1}^{N_{e}}\left(d^{l}_{j} - {d_{obs}} \right)^{T}C_{D}^{-1}\left(d^{l}_{j} - {d_{obs}} \right)\]- Parameters:
pred (NDArrayFloat) – Ensemble of prediction vector with shape (\(N_{\mathrm{obs}}, N_{e}\)), or single vector with shape \((N_{\mathrm{obs}},)\).
obs (NDArrayFloat) – Vector of observed values.
cov_obs – Cholesky upper factorisation of the covariance matrix of observed data measurement errors with dimensions (\(N_{\mathrm{obs}}\), \(N_{\mathrm{obs}}\)). Also denoted \(R\).
- Returns:
The objective function for each ensemble realization.
- Return type:
NDArrayFloat