Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc committed Aug 7, 2024
1 parent 0840412 commit 82b226e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 116 deletions.
50 changes: 0 additions & 50 deletions tests/test_fitter.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,3 @@
<<<<<<< HEAD
import pytest
import numpy as np
from duckreg.estimators import DuckRegression
from tests.utils import generate_sample_data, create_duckdb_database

@pytest.fixture(scope="session")
def database():
df = generate_sample_data()
db_name = 'test_dataset.db'
create_duckdb_database(df, db_name)

@pytest.mark.parametrize("fml", ["Y ~ D", "Y ~ D + f1", "Y ~ D + f1 + f2"])
@pytest.mark.parametrize("cluster_col", ["f1"])
def test_fitters(fml, cluster_col):

m_duck = DuckRegression(
db_name='test_dataset.db',
table_name='data',
formula=fml,
cluster_col=cluster_col,
n_bootstraps=20,
seed = 42
)
m_duck.fit()


m_feols = DuckRegression(
db_name='test_dataset.db',
table_name='data',
formula=fml,
cluster_col=cluster_col,
n_bootstraps=20,
seed = 42,
fitter = "feols"
).fit()

results = m_duck.summary()
coefs = results["point_estimate"]
se = results["standard_error"]

assert np.all(np.abs(coefs) - np.abs(m_feols.coef().values) < 1e-12), "Coeficients are not equal"
assert np.all(np.abs(se) - np.abs(m_feols.se().values) < 1e-12), "Standard errors are not equal"





=======
import numpy as np
import pytest
import os
Expand Down Expand Up @@ -121,4 +72,3 @@ def test_fitters(database, fml):
np.testing.assert_allclose(
compressed_coeffs, uncompressed_coeffs, rtol=1e-4
), f"Coefficients are not equal for formula {fml}"
>>>>>>> c88c1439a65d8ef6a7eaea720acd1341979490e7
66 changes: 0 additions & 66 deletions tests/test_vs_pyfixest.py

This file was deleted.

0 comments on commit 82b226e

Please sign in to comment.