-
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
Mean, Normalizer, Trend and Fitting #124
Conversation
@LSchueler this is finally ready for review. 😉 🎉 |
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.
Wow, what a tremendous piece of work... again ;-)
Unfortunately, I won't be able to finish this review today. But in case you'd like to here some criticism already, here it goes:
I don't like the argument only_mean
in Krige.__call__()
. I think that should be taken care of in a separate method. I'm afraid the __call__
method could get as cluttered as SRF.__call__()
was before you cleaned it up.
I also struggled with that one, but:
A separate routine would have more downsides IMHO. |
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 soo cool! - I'm really sorry I kept you waiting for so long for this review.
Some comments in the code and apart from that I'm still not convinced by the only_mean
argument in the Krige.__call__()
method. The structured
and unstructured
methods are only syntactic sugar and maybe a method Krige.the_mean
or Krige.krige_the_mean
might be much clearer.
But I wouldn't try to block this PR if you disagree ;-)
Fixed some typos on this branch, don't forget to pull. |
I'd like to keep it this way, since also |
@LSchueler thanks for the review. I updated everything. Merging this beast now! 🎉 |
Closes: #94
Abstract
This PR adds:
Purpose of Normalizer
Their purpose is to normalize (follow a normal distribution) and denormalize data.
Since Krige and SRF produce normal distributed fields, these normalizers offer the opportunity to transform fields into a desired distribution and, in case of krige, to normalize conditioning data beforehand.
Normalizer
Normalizer Fitting
In order to fit hyper-parameter of the normalization transformations, the Normalize base-class provides a
fit
method, that estimates parameters by maximizing the log-likelihood function for given data.Callable trend and mean
In order to use trends and variable means from external source to play nicely together with Normalizer, we will allow callable means to be added to normalized data and trends applied to input data.
Auto Fitting for Krige
SInce we provide an automated workflow for estimating the empirical variogram with automatic binning, we plug that into the kriging class as an automated workflow. In addition the normalizer can be fitted automatically as well by minimizing the likelihood function as described above.
Affected Routines
Field.post_field
(replacingKrige._post_field
and is similar toField.pre_pos
)Krige._krige_cond
needs to care about normalizer and callable mean in correct orderField.__init__
needstrend_function
,normalizer
andfit_normalizer
argumentsKrige.cond_mean
holding mean values at conditioning pointsTODO