## models.StackingFit


Posterior stacking weights, from [BayesStacking.fit](models.BayesStacking.md#prospicio.models.BayesStacking.fit) or


Usage


``` python
models.StackingFit()
```


[HierarchicalStacking.fit](models.HierarchicalStacking.md#prospicio.models.HierarchicalStacking.fit).


## Attributes

| Name | Description |
|----|----|
| [alpha_draws](#alpha_draws) | Intercept draws (the logits for Bayesian stacking), one row per draw, |
| [beta_draws](#beta_draws) | Slope draws, flattened draw by draw, model by model, covariate by |
| [divergences](#divergences) | Divergent transitions among the kept draws. |

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


#### alpha_draws


Intercept draws (the logits for Bayesian stacking), one row per draw,


`alpha_draws: list[float]`


one per model but the reference (last).


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


#### beta_draws


Slope draws, flattened draw by draw, model by model, covariate by


`beta_draws: list[float]`


covariate.


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


#### divergences


Divergent transitions among the kept draws.


`divergences: int`


## Methods

| Name | Description |
|----|----|
| [rhat_ess()](#rhat_ess) | R-hat and bulk ESS of each sampled parameter. |
| [weights()](#weights) | Posterior mean weights: one row per observation of `covariates` |

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


#### rhat_ess()


R-hat and bulk ESS of each sampled parameter.


Usage


``` python
rhat_ess()
```


##### Returns


`list of (float, float)`  


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


#### weights()


Posterior mean weights: one row per observation of `covariates`


Usage


``` python
weights(covariates=None)
```


(one list per covariate), one weight per model. For Bayesian stacking leave `covariates` empty: one row.


##### Parameters


`covariates: list of list of float = None`  


##### Returns


`list of list of float`
