## models.BayesGlmFit


A sampled Bayesian GLM, from [BayesGlm.fit](models.BayesGlm.md#prospicio.models.BayesGlm.fit).


Usage


``` python
models.BayesGlmFit()
```


## Attributes

| Name | Description |
|----|----|
| [chains](#chains) | Number of chains. |
| [coefficient_draws](#coefficient_draws) | Coefficient draws, one row per draw (chain by chain). |
| [dispersion_draws](#dispersion_draws) | Dispersion draws, one per draw (constant when fixed). |
| [divergences](#divergences) | Divergent transitions among the kept draws. |
| [names](#names) | Coefficient names. |
| [posterior_mean](#posterior_mean) | Posterior means of the coefficients. |

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


#### chains


Number of chains.


`chains: int`


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


#### coefficient_draws


Coefficient draws, one row per draw (chain by chain).


`coefficient_draws: list[list[float]]`


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


#### dispersion_draws


Dispersion draws, one per draw (constant when fixed).


`dispersion_draws: list[float]`


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


#### divergences


Divergent transitions among the kept draws.


`divergences: int`


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


#### names


Coefficient names.


`names: list[str]`


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


#### posterior_mean


Posterior means of the coefficients.


`posterior_mean: list[float]`


## Methods

| Name | Description |
|----|----|
| [log_likelihood()](#log_likelihood) | Pointwise log-likelihood of `y` given [design](models.Coding.md#prospicio.models.Coding.design): one row per draw, |
| [loo()](#loo) | PSIS-LOO of `y` given [design](models.Coding.md#prospicio.models.Coding.design), with each observation's relative |
| [predict()](#predict) | Posterior mean of each row's mean. |
| [predict_distribution()](#predict_distribution) | Posterior predictive draws across the rows, keyed `row = 0, 1, ...`. |
| [summary()](#summary) | Posterior summary: one dict per parameter with [name](reinsurance.Layer.md#prospicio.reinsurance.Layer.name), [mean](risk.Gpd.md#prospicio.risk.Gpd.mean), |

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


#### log_likelihood()


Pointwise log-likelihood of `y` given [design](models.Coding.md#prospicio.models.Coding.design): one row per draw,


Usage


``` python
log_likelihood(design, y)
```


one column per observation, for [elpd_loo](models.elpd_loo.md#prospicio.models.elpd_loo) or [elpd_waic](models.elpd_waic.md#prospicio.models.elpd_waic).


##### Returns


`list of list of float`  


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


#### loo()


PSIS-LOO of `y` given [design](models.Coding.md#prospicio.models.Coding.design), with each observation's relative


Usage


``` python
loo(design, y)
```


efficiency estimated from the chains.


##### Returns


`Elpd`  


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


#### predict()


Posterior mean of each row's mean.


Usage


``` python
predict(design)
```


##### Returns


`list of float`  


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


#### predict_distribution()


Posterior predictive draws across the rows, keyed `row = 0, 1, ...`.


Usage


``` python
predict_distribution(design, n_sims, seed)
```


##### Returns


`PredictiveDistribution`  


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


#### summary()


Posterior summary: one dict per parameter with [name](reinsurance.Layer.md#prospicio.reinsurance.Layer.name), [mean](risk.Gpd.md#prospicio.risk.Gpd.mean),


Usage


``` python
summary()
```


`sd`, `q05`, `q50`, `q95`, `rhat`, `ess_bulk` and `ess_tail`; the dispersion last when it was sampled.


##### Returns


`list of dict`
