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

CovModel: Update and Refactoring #109

Merged
merged 70 commits into from
Nov 18, 2020
Merged

CovModel: Update and Refactoring #109

merged 70 commits into from
Nov 18, 2020

Conversation

MuellerSeb
Copy link
Member

@MuellerSeb MuellerSeb commented Nov 11, 2020

This PR updates and refactors the covariance models:

  • Fitting routines now support input of directional empirical variograms to estimate anisotropy
  • add new rescale argument and attribute to the CovModel class to be able to rescale the len_scale (usefull for unit conversion or rescaling len_scale to coincide with the integral_scale like it's the case with the Gaussian model)
    See: [Refactor] prefere "cor" to specify userdefined CovModel #90, Strange number in a variogram function  PyKrige#119
  • added new len_rescaled attribute to the CovModel class, which is the rescaled len_scale: len_rescaled = len_scale / rescale
  • new method default_rescale to provide default rescale factor (can be overridden)
  • remove doctest calls
  • docstring updates in CovModel and derived models
  • updated all models to use the cor routine and make use of the rescale argument (See: [Refactor] prefere "cor" to specify userdefined CovModel #90)
  • TPL models got a separate base class to not repeat code
  • added new models (See: [Enhancement] more covariance models #88):
    • HyperSpherical: (Replaces the old Intersection model) Derived from the intersection of hyper-spheres in arbitrary dimensions. Coincides with the linear model in 1D, the circular model in 2D and the classical spherical model in 3D
    • SuperSpherical: like the HyperSpherical, but the shape parameter derived from dimension can be set by the user. Coincides with the HyperSpherical model by default
    • JBessel a hole model valid in all dimensions. The shape parameter controls the dimension it was derived from. For nu=0.5 this model coincides with the well known wave hole model.
    • TPLSimple a simple truncated power law controlled by a shape parameter nu. Coincides with the truncated linear model for nu=1
  • string representation of the CovModel class is new using a float precision (CovModel._prec=3) to truncate longish output
  • dimension validity check: raise a warning, if given model is not valid in the desired dimension (See: [Enhancement] dimensionality check for CovModel #86)
  • more comprehensive testing

@MuellerSeb MuellerSeb added enhancement New feature or request Refactoring Code-Refactoring needed here labels Nov 11, 2020
@MuellerSeb MuellerSeb added this to the 1.3 milestone Nov 11, 2020
@MuellerSeb MuellerSeb requested a review from LSchueler November 11, 2020 02:40
@MuellerSeb MuellerSeb self-assigned this Nov 11, 2020
@MuellerSeb MuellerSeb linked an issue Nov 11, 2020 that may be closed by this pull request
4 tasks
@MuellerSeb
Copy link
Member Author

@LSchueler thanks 😉
So I will add a test for rescale. Fitting should be tested better as well.

@MuellerSeb
Copy link
Member Author

Coverage at 92% now! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Refactoring Code-Refactoring needed here
Projects
None yet
2 participants