spreg.dgp.dgp_errproc

spreg.dgp.dgp_errproc(u, w, lam=0.5, model='sar', imethod='power_exp')[source]

dgp_errproc: generates pure spatial error process

Examples

>>> import numpy as np
>>> import libpysal
>>> from spreg import make_x, dgp_errproc
>>> rng = np.random.default_rng(12345)
>>> u = make_x(rng,25,mu=[0],varu=[1], method='normal')
>>> w  = libpysal.weights.lat2W(5, 5)
>>> w.transform = "r"
>>> dgp_errproc(u,w)[0:5,:]
array([[-1.43760658],
       [ 0.69778271],
       [-0.7750646 ],
       [-0.47750452],
       [-0.72377417]])