bayespecon.dgp.simulate_spatial_probit

bayespecon.dgp.simulate_spatial_probit(W=None, gdf=None, n=None, rho=0.35, beta=None, sigma_a=0.8, n_per_region=25, err_hetero=False, rng=None, seed=None, contiguity='queen')[source]

Simulate SpatialProbit-style binary outcome data.

DGP

a = (I-rho W)^(-1) sigma_a z (region effects), eta = X beta + a[region], y ~ Bernoulli(Phi(eta)).

param W:

Spatial unit structure. If W is provided it takes precedence; otherwise gdf is used with contiguity.

param gdf:

Spatial unit structure. If W is provided it takes precedence; otherwise gdf is used with contiguity.

param rho:

Spatial dependence in regional effects.

type rho:

float, default=0.35

param beta:

Coefficients including intercept. Defaults to [0.3, 1.0].

type beta:

np.ndarray, optional

param sigma_a:

Regional effect innovation scale.

type sigma_a:

float, default=0.8

param n_per_region:

Number of observations per region.

type n_per_region:

int, default=25

param err_hetero:

If True, generate heteroskedastic region effects with region-specific standard deviations \(\sigma_{a,j} = \sigma_a \sqrt{1 + \|\bar{x}_j\|^2}\) where \(\bar{x}_j\) is the mean regressor vector for region j.

type err_hetero:

bool, default=False

param rng:

Random state controls.

param seed:

Random state controls.

param contiguity:

GeoDataFrame neighbor rule when W is omitted.

type contiguity:

str, default=”queen”

returns:

Keys: y, X, region_ids, W_dense, W_graph, params_true.

rtype:

dict