spreg.dgp.dgp_spdurbin

spreg.dgp.dgp_spdurbin(u, xb, wxg, w, rho=0.5, imethod='power_exp', ybin=False)[source]
dgp_spdurbin: generates y for spatial Durbin model with xb, wxg, weights,

spatial parameter rho, error term, method for inverse transform

Examples

>>> import numpy as np
>>> import libpysal
>>> from spreg import make_x, make_xb, make_wx, make_wxg, dgp_spdurbin
>>> rng = np.random.default_rng(12345)
>>> u = make_x(rng,25,mu=[0],varu=[1], method='normal')
>>> x = make_x(rng,25,mu=[0],varu=[1])
>>> xb = make_xb(x,[1,2])
>>> w  = libpysal.weights.lat2W(5, 5)
>>> w.transform = "r"
>>> wx = make_wx(x,w)
>>> wxg = make_wxg(wx,[2])
>>> dgp_spdurbin(u,xb,wxg,w)[0:5,:]
array([[18.06895353],
       [15.18686487],
       [11.95080505],
       [12.55220513],
       [15.75805066]])