def test_make_plr_turrell2018_return_types(): np.random.seed(3141) res = make_plr_turrell2018(n_obs=100, return_type='DoubleMLData') assert isinstance(res, DoubleMLData) res = make_plr_turrell2018(n_obs=100, return_type='DataFrame') assert isinstance(res, pd.DataFrame) x, y, d = make_plr_turrell2018(n_obs=100, return_type='array') assert isinstance(x, np.ndarray) assert isinstance(y, np.ndarray) assert isinstance(d, np.ndarray) with pytest.raises(ValueError, match=msg_inv_return_type): _ = make_plr_turrell2018(n_obs=100, return_type='matrix')
def generate_data2(request): n_p = request.param np.random.seed(1111) # setting parameters n = n_p[0] p = n_p[1] theta = 0.5 # generating data data = make_plr_turrell2018(n, p, theta) return data
def generate_data2(request): N_p = request.param np.random.seed(1111) # setting parameters N = N_p[0] p = N_p[1] theta = 0.5 # generating data datasets = [] for i in range(n_datasets): data = make_plr_turrell2018(N, p, theta) datasets.append(data) return datasets