LCOGT / mop

Microlensing Observation Portal
GNU General Public License v3.0
0 stars 7 forks source link

Calculate, store and display model parameter uncertainties for best fitting model #74

Closed rachel3834 closed 12 months ago

rachel3834 commented 12 months ago

I have added new extra parameters to store the uncertainties for the Paczinski parameters, and modified mop.toolbox.fittools.gather_model_parameters to calcualate them from the covarience matrix of the best fitting model. The uncertainties are then stored in MOP for the best model and displayed on the TargetDetailPage for a given event.

In the course of this upgrade, I noticed I'd made some typos in the section of the mop.toolbox.fittools.fit_pspl_omega2 function that stores the parameters of the second model fit (without blending) with the first model (with blending). This meant that the comparison between the two models was never being made, leading to unstable results. I have now corrected this logic.

I would appreciate a code review to confirm that I have used the right PyLIMA syntax to extract the chi2 from the fit object (in the gather_model_parameters function), and a second pair of eyes to make sure the model comparison in fit_pspl_omega2 is now correct.

mpgh commented 12 months ago

For datasets with many contributing telescopes comparing the chi-squares could be challenging. Just fitting with or without blend changes the "degrees of freedom", perhaps comparing the AIC? As an immediate change the improvement should work for few telescopes. Ideally this should apply to most events before peak or anomaly and my concern can safely be ignored.

ebachelet commented 12 months ago

Looks good to me!