def test_clustered_covariance_error(self): with pytest.raises(ValueError): ClusteredCovariance(self.y, self.x, self.params, extra_df=0, clusters=self.cluster5) with pytest.raises(ValueError): ClusteredCovariance(self.y, self.x, self.params, extra_df=0, clusters=self.cluster4[::2])
def test_clustered_covariance_smoke(self): cov = ClusteredCovariance(self.y, self.x, self.params, self.time_ids, extra_df=0).cov assert cov.shape == (self.k, self.k) cov = ClusteredCovariance(self.y, self.x, self.params, self.time_ids, extra_df=0, clusters=self.cluster1).cov assert cov.shape == (self.k, self.k) cov = ClusteredCovariance(self.y, self.x, self.params, self.time_ids, extra_df=0, clusters=self.cluster2, group_debias=True).cov assert cov.shape == (self.k, self.k) cov = ClusteredCovariance(self.y, self.x, self.params, self.time_ids, extra_df=0, clusters=self.cluster3).cov assert cov.shape == (self.k, self.k) cov = ClusteredCovariance(self.y, self.x, self.params, self.time_ids, extra_df=0, clusters=self.cluster3, group_debias=True).cov assert cov.shape == (self.k, self.k) cov = ClusteredCovariance(self.y, self.x, self.params, self.time_ids, extra_df=0, clusters=self.cluster4).cov assert cov.shape == (self.k, self.k) cov = ClusteredCovariance(self.y, self.x, self.params, self.time_ids, extra_df=0, clusters=self.cluster4, group_debias=True).cov assert cov.shape == (self.k, self.k)
def test_clustered_covariance_error(panel_data) -> None: with pytest.raises(ValueError): ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster5, ) with pytest.raises(ValueError): ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster4[::2], )
def test_clustered_covariance_error(self) -> None: with pytest.raises(ValueError): ClusteredCovariance( self.y, self.x, self.params, self.entity_ids, self.time_ids, extra_df=0, clusters=self.cluster5, ) with pytest.raises(ValueError): ClusteredCovariance( self.y, self.x, self.params, self.entity_ids, self.time_ids, extra_df=0, clusters=self.cluster4[::2], )
def test_clustered_covariance_smoke(panel_data) -> None: cov = ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, ).cov assert cov.shape == (panel_data.k, panel_data.k) cov = ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster1, ).cov assert cov.shape == (panel_data.k, panel_data.k) cov = ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster2, group_debias=True, ).cov assert cov.shape == (panel_data.k, panel_data.k) cov = ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster3, ).cov assert cov.shape == (panel_data.k, panel_data.k) cov = ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster3, group_debias=True, ).cov assert cov.shape == (panel_data.k, panel_data.k) cov = ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster4, ).cov assert cov.shape == (panel_data.k, panel_data.k) cov = ClusteredCovariance( panel_data.y, panel_data.x, panel_data.params, panel_data.entity_ids, panel_data.time_ids, extra_df=0, clusters=panel_data.cluster4, group_debias=True, ).cov assert cov.shape == (panel_data.k, panel_data.k)