File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -60,3 +60,22 @@ def test_generate_regression_discontinuity_data():
6060 N = 50 , true_causal_impact = 1.0 , true_treatment_threshold = 0.5
6161 )
6262 assert len (df_custom ) == 50
63+
64+
65+ def test_generate_synthetic_control_data ():
66+ """
67+ Test the generate_synthetic_control_data function.
68+ """
69+ from causalpy .data .simulate_data import generate_synthetic_control_data
70+
71+ # Test with default parameters (lowess_kwargs=None)
72+ df , weightings = generate_synthetic_control_data ()
73+ assert isinstance (df , pd .DataFrame )
74+ assert isinstance (weightings , np .ndarray )
75+ assert len (df ) == 100 # default N value
76+
77+ # Test with explicit lowess_kwargs
78+ df_custom , weightings_custom = generate_synthetic_control_data (
79+ N = 50 , lowess_kwargs = {"frac" : 0.3 , "it" : 5 }
80+ )
81+ assert len (df_custom ) == 50
You can’t perform that action at this time.
0 commit comments