{"action":"created","issue":{"url":"https://api.github.com/repos/mmaelicke/scikit-gstat/issues/11","repository_url":"https://api.github.com/repos/mmaelicke/scikit-gstat","labels_url":"https://api.github.com/repos/mmaelicke/scikit-gstat/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/mmaelicke/scikit-gstat/issues/11/comments","events_url":"https://api.github.com/repos/mmaelicke/scikit-gstat/issues/11/events","html_url":"https://github.com/mmaelicke/scikit-gstat/issues/11","id":348497393,"node_id":"MDU6SXNzdWUzNDg0OTczOTM=","number":11,"title":"Option to omit last bin when maxlag is set","user":{"login":"tnigon","id":8249296,"node_id":"MDQ6VXNlcjgyNDkyOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/8249296?v=4","gravatar_id":"","url":"https://api.github.com/users/tnigon","html_url":"https://github.com/tnigon","followers_url":"https://api.github.com/users/tnigon/followers","following_url":"https://api.github.com/users/tnigon/following{/other_user}","gists_url":"https://api.github.com/users/tnigon/gists{/gist_id}","starred_url":"https://api.github.com/users/tnigon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tnigon/subscriptions","organizations_url":"https://api.github.com/users/tnigon/orgs","repos_url":"https://api.github.com/users/tnigon/repos","events_url":"https://api.github.com/users/tnigon/events{/privacy}","received_events_url":"https://api.github.com/users/tnigon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-07T21:40:31Z","updated_at":"2018-08-08T07:07:27Z","closed_at":"2018-08-08T06:58:15Z","author_association":"NONE","body":"When using a maxlag value, the last bin in the semivariogram seems to consist of all data with a greater value than maxlag. Therefore, when a model is fit to the binned values of the semivariogram, that last bin value affects the model substantially if it is different from the 2nd to last bin value. I'm not sure this is what is the desired behavior, but if it is, would it make sense to provide an option to the user for fitting the model after omitting the last bin (would only apply when maxlag is set)?\r\n\r\n![See a sample semivariogram here](https://user-images.githubusercontent.com/8249296/43803063-5a31353a-9a5d-11e8-8985-54cad0ed354b.png) where maxlag was set and the last bin is at a value of ~600, whereas the 2nd to last bin is at a value close to 1000. Notice the spherical model (green line) shows a sill that is clearly at a value less than those suggested by the points.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mmaelicke/scikit-gstat/issues/comments/411308492","html_url":"https://github.com/mmaelicke/scikit-gstat/issues/11#issuecomment-411308492","issue_url":"https://api.github.com/repos/mmaelicke/scikit-gstat/issues/11","id":411308492,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTMwODQ5Mg==","user":{"login":"mmaelicke","id":2826034,"node_id":"MDQ6VXNlcjI4MjYwMzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2826034?v=4","gravatar_id":"","url":"https://api.github.com/users/mmaelicke","html_url":"https://github.com/mmaelicke","followers_url":"https://api.github.com/users/mmaelicke/followers","following_url":"https://api.github.com/users/mmaelicke/following{/other_user}","gists_url":"https://api.github.com/users/mmaelicke/gists{/gist_id}","starred_url":"https://api.github.com/users/mmaelicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmaelicke/subscriptions","organizations_url":"https://api.github.com/users/mmaelicke/orgs","repos_url":"https://api.github.com/users/mmaelicke/repos","events_url":"https://api.github.com/users/mmaelicke/events{/privacy}","received_events_url":"https://api.github.com/users/mmaelicke/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T07:07:27Z","updated_at":"2018-08-08T07:07:27Z","author_association":"OWNER","body":"BTW, in my working group I wrote [this notebook](https://github.com/KIT-HYD/microstudies/blob/master/fitting/variogram_fitting.ipynb)  as a guideline for our students, how one can fit a theoretical variogram. Most of the stuff is already implemented into the Variogram class. When using 'trf' as fit_method (default now), it will set the bounds and initial guess automatically. The uncertainty of the bins can be set through the fit_sigma attribute, which docstring looks like:\r\n\r\n\r\n\r\n        Set or calculate an array of observation uncertainties aligned to the\r\n        Variogram.bins. These will be used to weight the observations in the\r\n        cost function, which divides the residuals by their uncertainty.\r\n\r\n        When setting fit_sigma, the array of uncertainties itself can be\r\n        given, or one of the strings: ['linear', 'exp', 'sqrt', 'sq']. The\r\n        parameters described below refer to the setter of this property.\r\n\r\n        Parameters\r\n        ----------\r\n        sigma : string, array\r\n            Sigma can either be an array of discrete uncertainty values,\r\n            which have to align to the Variogram.bins, or of type string.\r\n            Then, the weights for fitting are calculated as a function of\r\n            (lag) distance.\r\n\r\n              * sigma='linear': The residuals get weighted by the lag\r\n              distance normalized to the maximum lag distance, denoted as w_n\r\n              * sigma='exp': The residuals get weighted by the function:\r\n              w = e^{1 / w_n}\r\n              * sigma='sqrt': The residuals get weighted by the function:\r\n              w = sqrt(w_n)\r\n              * sigma='sq': The residuals get weighted by the function:\r\n              w = w_n ** 2\r\n\r\n        Returns\r\n        -------\r\n        void\r\n\r\n\r\n        Notes\r\n        -----\r\n        The cost function is defined as:\r\n\r\n        .. math::\r\n            chisq = \\sum {\\frac{r}{\\sigma}}^2\r\n\r\n        where r are the residuals between the experimental variogram and the\r\n        modeled values for the same lag. Following this function,\r\n        small values will increase the influence of that residual, while a very\r\n        large sigma will cause the observation to be ignored.\r\n\r\n\r\nHope, this is helpful for you. \r\nBest\r\n\r\nMirko"}}
{"actor":{"display_login":"mmaelicke"}}