## evaluate.eval_crps()


Empirical CRPS averaged over all data elements.


Usage

``` python
evaluate.eval_crps(
    pred,
    truth,
    *,
    batch_size=None,
)
```


A pure JAX scalar kernel (see [Metric](typing.Metric.md#numpyro_forecast.typing.Metric)). An integer `pred` or `truth` (the draws of a count model) is cast to the default float dtype (`float_view()`), one `batch_size` block at a time on the chunked path.


## Parameters


`pred: Real[ArrayLike, ``" sample *batch"]`  
Forecast samples with the sample axis first.

`truth: Real[ArrayLike, ``" *batch"]`  
Ground-truth values (matching `pred` without the sample axis).

`batch_size: int | None = None`  
Optional number of flattened data cells (the product of the batch shape, e.g. time times series) evaluated on the accelerator per pass; the sample axis is never chunked. With host-resident inputs (e.g. draws sampled with `device="host"`) this bounds accelerator memory by `sample * batch_size` values plus the CRPS sort workspace instead of the full panel, since both `pred` and `truth` are staged as NumPy views before chunking, whatever their own memory kind. Chunking only changes the summation order of the final mean (results are equal to float tolerance, not bitwise); at or above the cell count the single-pass path runs instead, which moves any host-committed operand back to device memory first (`float_view()`) so either `pred` or `truth` (or both) may be host-committed regardless of `batch_size`. `None` (default) evaluates in one pass.


## Returns


`Array`  
The mean empirical CRPS as a scalar array.


## Raises


`ValueError`  
If `truth.shape` is not `pred.shape[1:]` (see [Metric](typing.Metric.md#numpyro_forecast.typing.Metric)).
