-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Refactor] prefere "cor" to specify userdefined CovModel #90
Comments
Could you elaborate on why only In Terms of GS-Framework v2 this might be helpful to limit the user-defined models of There are also instances, where a covariance function is not defined, but a variogram is. From my point of view, it would also be a more clearer notation if not any |
The only valid variograms models, that we are excluding, are the unbounded ones. So if we want to support unbounded variograms, I think this should be represented by a new class. The RandMeth class only takes bounded variograms to generate randomfields, since it is depending on the spectral density of the covariance. And the covariance only exists for bounded variograms. In addition, the spectral density is only a real "density" function, if the covariance/varigram model is valid (conditional negative semidefinite). If we implement unbounded variograms, we should also provide a SRF generator for these. (Sequential Gaussian, Turning bands, ... something like this) |
@mmaelicke : The variogram in GSTools is represented by:
If you use the CovModel class to create your own variogram, and you override the variogram method to define it, you have to take care of variance, len_scale and nugget, so everything is still working (fitting, random field generation, integral_scale resetting and so on...) If you only define class Gau(gs.CovModel):
def cor(self, h):
return np.exp(-h ** 2) This reproduces the gaussian variogram. |
@MuellerSeb ah, ok. Got it. Will be interesting how we bring scikit-gstat to play well here in a v2.... But that's not the issue here. From what you write above, I would let the user define only On the other hand, if you feel more comfortable using variograms (like taught in some gestatisitics classes) it would still be nice to use |
This approach also allows to implement a rescaling factor vario(r) = var * (1 - cor(R * r / len_scale)) + nugget This could be used to normalize the range, to perform a unit conversion or to use the earth radius with the yadrenko models (see #54). See also: GeoStat-Framework/PyKrige#119 |
@mmaelicke: Just a note: the |
@MuellerSeb, thanks for clarifying. |
@mmaelicke I will keep all methods. Just be sure what you are doing! See #109 |
At the moment we allow to specify one of the following functions for a user-defined model:
variogram
- full variogram including variance, nugget, length-scale and potential additional parameterscovariance
- covariance only including variance, length-scale and potential additional parameterscorrelation
- correlation only including length-scale and potential additional parameterscor
- normalized correlation depending on the non-dimensional distance only including potential additional parametersOnly the
cor
method is a save way of defining a fully working CovModel which results in the standard definition from the documentation, so we should think about sticking to this one as the standard way of defining a CovModel.The text was updated successfully, but these errors were encountered: