## models.ppc_check()


Posterior predictive checks of any model: each test statistic of


Usage


``` python
models.ppc_check(
    observed,
    replicated,
    statistics=None,
    groups=None,
)
```


`observed` against its distribution over the replicated datasets, with the p-value `P(T(y_rep) >= T(y))` (ties count half). With [groups](distributions.PredictiveDistribution.md#prospicio.distributions.PredictiveDistribution.groups), each statistic is checked within each group.


## Parameters


`observed: list of float`  

`replicated: list of list of float`  
One replicated dataset per posterior draw, each as long as `observed`.

`statistics: list of str or float = [``"mean", `<span class="st">`"sd"``, ``"min"``, ``"max"``]`</span>  
`"mean"`, `"sd"`, `"min"`, `"max"`, `"proportion_zero"`, or a probability for that quantile.

`groups: list of int = None`  
Each observation's group, from 0.


## Returns


`list of dict`  
[name](aggregate.Ledger.md#prospicio.aggregate.Ledger.name), `observed`, `replicated` and `p_value`.


## Examples

``` python
>>> from prospicio.models import ppc_check
>>> c = ppc_check([1.0, 3.0], [[0.0, 2.0], [2.0, 4.0], [1.0, 3.0]], ["mean"])
>>> c[0]["observed"], c[0]["p_value"]
```

(2.0, 0.5)
