spreg.dgp.dgp_slxerror

spreg.dgp.dgp_slxerror(u, xb, wxg, w, lam=0.5, model='sar', imethod='power_exp', ybin=False)[source]
dgp_slxerror: generates y for SLX spatial error model with xb, wxg, weights,

spatial parameter lam, model type (sar or ma), 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_slxerror
>>> 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_slxerror(u,xb,wxg,w)[0:5,:]
array([[8.84476235],
       [6.6093012 ],
       [3.93234334],
       [4.51270801],
       [7.7217999 ]])