# PosteriorPredictResult


Container returned by [GAM.posterior_predict()](GAM.md#whittaker.GAM.posterior_predict).


Usage

``` python
PosteriorPredictResult(samples)
```


Holds the full `(n, n_draws)` posterior predictive sample matrix and provides convenience methods for computing quantile summaries, means, and intervals.


## Attributes


`samples: numpy.ndarray`  
Posterior predictive draws, shape `(n, n_draws)`. Each column is one draw from the posterior predictive distribution (coefficient uncertainty *plus* observation noise).


## Attributes

| Name | Description |
|----|----|
| [n_draws](#n_draws) | Number of posterior draws. |
| [n_obs](#n_obs) | Number of prediction points. |

------------------------------------------------------------------------


### n_draws


Number of posterior draws.


`n_draws: int`


------------------------------------------------------------------------


### n_obs


Number of prediction points.


`n_obs: int`


## Methods

| Name | Description |
|----|----|
| [interval()](#interval) | Equal-tailed posterior predictive interval. |
| [mean()](#mean) | Posterior predictive mean at each observation, shape `(n,)`. |
| [quantile()](#quantile) | Compute quantile(s) of the posterior predictive distribution. |
| [std()](#std) | Posterior predictive standard deviation at each observation, shape `(n,)`. |

------------------------------------------------------------------------


### interval()


Equal-tailed posterior predictive interval.


Usage

``` python
interval(level=0.95)
```


#### Parameters


`level: float = ``0.95`  
Coverage probability (default 0.95).


#### Returns


`tuple[NDArray, NDArray]`  
`(lower, upper)` arrays, each of shape `(n,)`.


------------------------------------------------------------------------


### mean()


Posterior predictive mean at each observation, shape `(n,)`.


Usage

``` python
mean()
```


------------------------------------------------------------------------


### quantile()


Compute quantile(s) of the posterior predictive distribution.


Usage

``` python
quantile(q)
```


#### Parameters


`q: float | list[float]`  
Quantile(s) in \[0, 1\]. A scalar returns shape `(n,)`; a list returns `(len(q), n)`.


------------------------------------------------------------------------


### std()


Posterior predictive standard deviation at each observation, shape `(n,)`.


Usage

``` python
std()
```
