Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jacobian to GeneralizedLorentz1D, SmoothBrokenPowerLaw in stingray.simulator.models #889

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ankitkhushwaha
Copy link
Contributor

@ankitkhushwaha ankitkhushwaha commented Feb 24, 2025

TODO:

i have added the jacabian for each parameter in both GeneralizedLorentz1D, SmoothBrokenPowerLaw function.

i have confirmed that jacobian for function with respect to each parameter is correct.

@matteobachetti

@ankitkhushwaha ankitkhushwaha marked this pull request as draft February 24, 2025 12:24
@ankitkhushwaha ankitkhushwaha marked this pull request as ready for review February 25, 2025 12:27
@ankitkhushwaha
Copy link
Contributor Author

ankitkhushwaha commented Feb 25, 2025

I think changes are ready for review.
@matteobachetti

@matteobachetti
Copy link
Member

@ankitkhushwaha thanks for your PR. However, I haven't noticed any tests failing, there are no issues open about it as far as I can tell. Could you be clearer about what is failing, and what your changes do?

@ankitkhushwaha
Copy link
Contributor Author

ankitkhushwaha commented Feb 25, 2025

@matteobachetti
in the first commit. Function GeneralizedLorentz1D, SmoothBrokenPowerLaw was returning the jacobian and function output as tuple. that's why some test are falling.

these test are fixed now.

TODO:
I have added the Jacobian functionality for GeneralizedLorentz1D, SmoothBrokenPowerLaw which will compute the derivative of their function with respective to each parameter.

Copy link

codecov bot commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 27.36842% with 69 lines in your changes missing coverage. Please review.

Project coverage is 46.31%. Comparing base (a91c031) to head (4fc246e).

Files with missing lines Patch % Lines
stingray/simulator/models.py 27.36% 69 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (a91c031) and HEAD (4fc246e). Click for more details.

HEAD has 22 uploads less than BASE
Flag BASE (a91c031) HEAD (4fc246e)
23 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #889       +/-   ##
===========================================
- Coverage   96.03%   46.31%   -49.73%     
===========================================
  Files          48       48               
  Lines        9770     9855       +85     
===========================================
- Hits         9383     4564     -4819     
- Misses        387     5291     +4904     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ankitkhushwaha
Copy link
Contributor Author

Hey @matteobachetti, mostly this pr is ready to be reviewed, could you review this.
more tests needs to added that i will add in upcoming commits.

fitter_with_deriv = fitting.LevMarLSQFitter()
new_model_with_deriv = fitter_with_deriv(model_with_deriv, x, data)
fitter_no_deriv = fitting.LevMarLSQFitter()
new_model_no_deriv = fitter_no_deriv(model_no_deriv, x, data, estimate_jacobian=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

under the hood fit_driv function is called when
new_model_no_deriv = fitter_no_deriv(model_no_deriv, x, data, estimate_jacobian=True)
is called also model(x) will executes evalate function.
i am wondering why codecov is falling.
will check it later on .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants