run_posterior_mcmc
validation.run_posterior_mcmc(
Yc_obs,
spatial_W,
spatial_w,
alpha,
*,
X=None,
p=0,
a0=1.0,
b0=1.0,
rho_support=None,
step_rho=0.05,
m_burn=5000,
m_keep=20000,
thin=1,
seed=123,
kernel='simple',
)Sample the Step-2 posterior on a fixed panel under explicit priors.
kernel="simple" iterates the appendix’s simplified sweep (:class:~scspill.validation.kernels.SimpleKernel) on the observed panel, mirroring the R run_mcmc_for_posterior; kernel="production" re-runs the production Step-2 sampler with the overridden priors and support.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Yc_obs | np.ndarray | Observed donor pre-period panel, shape (T0, N). |
required |
| spatial_W | np.ndarray | Raw spatial weights (normalized internally). | required |
| spatial_w | np.ndarray | Raw spatial weights (normalized internally). | required |
| alpha | np.ndarray | Fixed synthetic weights, shape (N,). |
required |
| X | np.ndarray | Covariate cube (T0, N, K). |
None |
| p | int | Number of latent factors. | 0 |
| a0 | float | Inverse-gamma prior for sigma^2. |
1.0 |
| b0 | float | Inverse-gamma prior for sigma^2. |
1.0 |
| rho_support | (float, float) | Support for rho (defaults to the spectral bound of A). |
None |
| step_rho | float | Fixed Metropolis step. | 0.05 |
| m_burn | int | Burn-in, retained draws, and thinning interval. | 5000 |
| m_keep | int | Burn-in, retained draws, and thinning interval. | 5000 |
| thin | int | Burn-in, retained draws, and thinning interval. | 5000 |
| seed | int | Random seed. | 123 |
| kernel | ('simple', 'production') | "simple" |
Returns
| Name | Type | Description |
|---|---|---|
| PosteriorSummary |