neighbayes.dgp.simulate_sar_hurdle_negbin¶
-
neighbayes.dgp.simulate_sar_hurdle_negbin(n_side=
None, W=None, gdf=None, rho=0.4, rho_zero=0.3, beta=None, beta_zero=None, alpha=2.0, X_zero=None, X=None, W_zero=None, rng=None, seed=None, contiguity='queen', target_pi=None, err_hetero=False, create_gdf=False, geometry_type='polygon', latent=True, *, T=None, N=None, unit_effects=None, time_effects=False, unit_effect_sd=None, time_effect_sd=None)[source]¶ Simulate a reduced-form SAR hurdle NB cross-section.
\[\eta_z = (I - \rho_z W_z)^{-1} X_z\beta_z, \qquad \eta^{\mathrm{c}} = (I - \rho W)^{-1} X\beta,\]d ~ Bernoulli(logit⁻¹(η_z))andy = d · tNB(e^{η^c}, α).With
latent=True, the default, it draws the latent hurdle the unmarkedSARHurdleNegBinfits, each part’s own disturbance propagated:d = 1(u > 0),u = (I − ρ_z W_z)⁻¹(X_z β_z + ε_z)withε_zlogistic, andy | d = 1Poisson(e^η) truncated at zero,η = (I − ρW)⁻¹(Xβ + ε)withε = log γ,γ ~ Gamma(α, α);eta_zeroandeta_cntare then the drawnuandη.- Parameters:¶
- rho : float¶
Count- and zero-part spatial parameters.
- rho_zero : float¶
Count- and zero-part spatial parameters.
- beta : array-like, optional¶
Count- and zero-part coefficients, intercept first; defaults
[1.0, 0.6]and[0.3, 1.0].- beta_zero : array-like, optional¶
Count- and zero-part coefficients, intercept first; defaults
[1.0, 0.6]and[0.3, 1.0].- alpha : float, default 2.0¶
NB2 dispersion of the count part.
- target_pi : float, optional¶
Shift the zero part’s intercept (inside the filter) so
mean P(y > 0)equalstarget_pi;params_true["beta_zero"]reports the shifted coefficients.- err_hetero : bool, default False¶
Accepted for API parity; the count variance is set by the mean and
alpha, so it is ignored with a warning.- n_side=
None¶ As for
simulate_sar_zinb().- W=
None¶ As for
simulate_sar_zinb().- gdf=
None¶ As for
simulate_sar_zinb().- X_zero=
None¶ As for
simulate_sar_zinb().- X=
None¶ As for
simulate_sar_zinb().- W_zero=
None¶ As for
simulate_sar_zinb().- rng=
None¶ As for
simulate_sar_zinb().- seed=
None¶ As for
simulate_sar_zinb().- contiguity=
'queen'¶ As for
simulate_sar_zinb().- create_gdf=
False¶ As for
simulate_sar_zinb().- geometry_type=
'polygon'¶ As for
simulate_sar_zinb().
- Returns:¶
y,d,X,X_zero,eta_zero,eta_cnt,W_sparse,W_graph,W_zero_sparse,W_zero_graph,params_true.- Return type:¶