Add eva main function and add eva.fit_gev fitstart options #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
main()
function to eva.py so that GEV parameters can be saved in a workflow.pip install --no-deps -e .
)lmoments3
toci/environment.yml
eva.fit_gev
:test_fit_goodness
=>assert_good_fit
test_relative_fit
=>pick_best_model
fitstart
that replacesgenerate_estimates
anduser_estimates
. The new keyword can be a string or a list of initial estimates.LMM
is very good, but keptscipy_fitstart
as the default because it reproduces the originalscipy.stats.genextreme.fit
method. Thescipy_fitstart
andscipy
difference is a bit confusing because using'scipy'
will basically fit the parameters twice.generate_estimates
can be reproduced usingscipy_subset
orretry_fit
.retry_fit
, which retries the fit using a different initial estimate - generated by running the same fitstart method with data[::2]. If the retry attempt is not better than the first estimate (based on the log-likelihood), then the original parameters are returned. We could retry the fit using different fitstart methods, but I don't think this is a good idea because it could impact reproducibility.pytest
fixtures.fit_gev
output so that is more consistent withxclim.indices.stats.fit
, including renamingtheta
=>dparams
and adding attributes tofit_gev
output.check_gev_fit
: The goodness of fit test is now based on the one-sample Kolmogorov-Smirnov or Cramér-von Mises test.fit_stationary_gev
gev_confidence_interval
- it is a vectorised version of the CI bootstrapping methods used in the eva plots (return periods or return levels). It still needs some work - I can finish it if it is needed.