anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: kevin218/eureka
Issue: Stage 5 reduced chi-squared calculation is messed up

For some reason the Stage 5 reduced chi-squared calculation is now messed up. When fitting the noise level using the scatter_mult parameter and using the dynesty sampler, I get a very reasonable looking fit with reasonable looking error bars, and my fig550_res_distri plot looks reasonable, but I get enormous reduced chi-squared values (e.g. 465.03078651787916 for MIRI's longest wavelength bin which used to give 1.0049324562175084 for basically the exact same ending lnprob). Not sure what could be causing that issue

Changed files:
eureka/S5_lightcurve_fitting/models/Model.py

diff --git a/eureka/S5_lightcurve_fitting/models/Model.py b/eureka/S5_lightcurve_fitting/models/Model.py
index 8d7e7908..6904a213 100644
--- a/eureka/S5_lightcurve_fitting/models/Model.py
+++ b/eureka/S5_lightcurve_fitting/models/Model.py
@@ -298,9 +298,10 @@ class CompositeModel(Model):
         # Get the time
         if self.time is None:
             self.time = kwargs.get('time')
-            
-        flux = np.ones(len(self.time)*self.nchan)
-        
+
+        # Set the default value
+        flux = np.zeros(len(self.time)*self.nchan)
+
         # Evaluate flux
         for model in self.components:
             if model.modeltype == 'GP':