spreg.dgp.dgp_ols¶
- spreg.dgp.dgp_ols(u, xb)[source]¶
dgp_ols: generates y for non-spatial process with given xb and error term u
Examples
>>> import numpy as np >>> import libpysal >>> from spreg import make_x, dgp_ols >>> 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]) >>> dgp_ols(u,xb)[0:5,:] array([[5.22803968], [3.60291127], [1.02632633], [1.37589879], [5.07165754]])