-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
ENH: Introducing local sensitivity analysis #575
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #575 +/- ##
===========================================
- Coverage 75.87% 74.40% -1.47%
===========================================
Files 85 89 +4
Lines 10085 10335 +250
===========================================
+ Hits 7652 7690 +38
- Misses 2433 2645 +212 ☔ View full report in Codecov by Sentry. |
58b1cdf
to
1c7f84d
Compare
Tests are not passing
Could you fix it before our review, please? That would help us. @Lucas-Prates |
Sure, I will fix it briefly. This simplified type hinting started at python 3.9. I will make sure the tests pass this time. :P |
Please be aware of #444, we are not supporting type hinting or annotations yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a partial review. I could not run your codes to validate it is working, but I suggested a few changes that might improve the quality (i.e. readability) of the code.
171ad30
to
8bbb7c4
Compare
8bbb7c4
to
259d026
Compare
a84127e
to
f0d0d62
Compare
The PR is ready for review again. I fixed a bug on the computations of the sensitivity score and it explained why the model was failing overall. Now it works for several target variables and for more complex environments (e.g. forecasted atmosphere). The sensitivity model usage and sensitivity simulation notebooks are the most important to review. There are still a couple of things left to do:
|
d7be791
to
4b3fd03
Compare
2e13896
to
522c8fe
Compare
@Gui-FernandesBR and @MateusStano, this PR is ready for review again! I believe the review should be somewhat quick. The code has already been thoroughly review, so I recommend focusing on two files:
In both cases, my recommendation is to read the text and check if it is clear. I wouldn't mind much about the mathematics, I took a second look at it and "looks fine." Moreover, I would like to know from you if the example I provided makes sense. It is very simplified, but I would hope it somehow creates the impression that sensitivity analysis can be useful. @Gui-FernandesBR, I tried to address the "LAE is too large" by giving a pragmatic recommendation of how to use the tool. Giving an exact value of what is "too large" is, in my opinion, not easy/feasible right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Lucas-Prates your proposed example is exactly what we needed when we created the issue. Problem solved, thank you so much! |
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallyCurrent behavior
The Sensitivity Analysis notebook teaches the users how to perform the simulations, plot the distribution
of some flight variables (e.g. apogee), and computes the prediction ellipses for the landing point.
New behavior
Our goal is to take sensitivity analysis even further. Briefly, we attempt to answer the following question: Which parameters would reduce the variability of the variable of interest (e.g. apogee) the most if we measured them with greater precision?
To that end, a bit of theory is developed, check the technical document. What was developed resembles the work of [1], a core reference in sensitivity analysis for engineering. His approach is a global sensitivity analysis with a full model containing interaction terms. Our first implementation considers a local sensitivity analysis using only first-order terms.
A quick and dirty test of the functionality of the SensitivityModel class is provided the "sensitivity_model_usage" notebook. This notebook is currently giving weird results! The linear approximations for the variables are, for some reason I still have to figure out, not good enough. This was not happening at previous experimentations that suggested that this approached worked. I have to look carefully at what is happening, but I did not want to delay the PR.
The concepts are discussed in-depth in the "sensitivity_analysis_parameter_importance" notebook (the notebook was not updated to the new SensitivityModel yet!)
Breaking change
Additional information
Technical Document
[1] Sobol, Ilya M. "Global sensitivity indices for nonlinear mathematical models and their Monte Carlo estimates." Mathematics and computers in simulation