spreg.dgp.dgp_mess¶
- spreg.dgp.dgp_mess(u, xb, w, rho=0.5)[source]¶
- dgp_mess: generates y for MESS spatial lag model with xb, weights,
spatial parameter rho (gets converted into alpha), sigma/method for the error term
Examples
>>> import numpy as np >>> import libpysal >>> from spreg import make_x, make_xb, dgp_mess >>> 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" >>> dgp_mess(u, xb, w)[0:5,:] array([[10.12104421], [ 7.45561055], [ 5.32807674], [ 5.55549492], [ 8.62685145]])