{"id":20482823,"url":"https://github.com/oliverhennhoefer/r-averaged-difference-algorithm","last_synced_at":"2025-03-05T15:47:43.156Z","repository":{"id":173469495,"uuid":"264028632","full_name":"OliverHennhoefer/r-averaged-difference-algorithm","owner":"OliverHennhoefer","description":"R-Implementation of the \"Averaged Difference Algorithm\" for Spatial Outlier Detection conceived by Yufeng Kou and Chang-Tien Lu (2006).","archived":false,"fork":false,"pushed_at":"2022-04-01T09:29:15.000Z","size":461,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T04:16:58.390Z","etag":null,"topics":["algorithm","averaged","avgdiff","chang-tien","detection","difference","farming","implementation","kou","lu","outlier","precision","r","spatial","weighted","yield","yufeng"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OliverHennhoefer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-14T21:25:37.000Z","updated_at":"2022-04-01T09:29:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d7e57cf-0daf-4783-87b2-aaaf1f90e6ad","html_url":"https://github.com/OliverHennhoefer/r-averaged-difference-algorithm","commit_stats":null,"previous_names":["oliverhennhoefer/r-averaged-difference-algorithm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverHennhoefer%2Fr-averaged-difference-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverHennhoefer%2Fr-averaged-difference-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverHennhoefer%2Fr-averaged-difference-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OliverHennhoefer%2Fr-averaged-difference-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OliverHennhoefer","download_url":"https://codeload.github.com/OliverHennhoefer/r-averaged-difference-algorithm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242058087,"owners_count":20065062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","averaged","avgdiff","chang-tien","detection","difference","farming","implementation","kou","lu","outlier","precision","r","spatial","weighted","yield","yufeng"],"created_at":"2024-11-15T16:14:42.378Z","updated_at":"2025-03-05T15:47:43.143Z","avatar_url":"https://github.com/OliverHennhoefer.png","language":"R","readme":"# Averaged Difference Algorithm\nR-Implementation of the \"Averaged Difference\"-Algorithm for Spatial Outlier Detection conceived by Yufeng Kou and Chang-Tien Lu in the scientific paper \"Spatial Weighted Outlier Detection\" from 2006. The algorithm is suitable for the detection of point observations with distinct features from their surrounding neighbors.\u003cbr/\u003e\nThe algorithm is demonstrated by the means of agricultural yield data and is generally suitable especially for use in the context of Precision Farming.\u003cbr/\u003e\n\n:round_pushpin: disy Informationssysteme GmbH. https://www.disy.net/de/ \u003cbr/\u003e\n:seedling: iFAROS. https://www.ifaros-ictagri.com/ \u003cbr/\u003e\n\n## Dependencies:\u003cbr/\u003e\n:wrench: __sp__-package, for geometry types\u003cbr/\u003e\n:wrench: __data.table__-package, as faster alternative for _base::data.frame_\u003cbr/\u003e\n:wrench: __FNN__-package, for k-nearest-neighbor search algorithm\u003cbr/\u003e\n\n## Parameters:\u003cbr/\u003e\n- Input: _SpatialDataPointsDataFrame_, georeferenced point data with attribute(s)\u003cbr/\u003e\n- Input: _k_, number of neighbours taken into account (as in _k-Nearest-Neighbor_)\u003cbr/\u003e\n- Output: _data.table_, containing index and the corresponding _averaged difference_ in decreasing order\u003cbr/\u003e\u003cbr/\u003e\n\nThe function returns a list (data.table) with points indices and the _averaged difference_ of the respective point. The data.table allows for the deletion of the top _n_ outliers by their indices. The actual number of outliers to be deleted can be freely chosen by the user.\u003cbr/\u003e\nFor the example shown, 1.200 points (of ~ 8.000 points) were deleted. The nearest neighbors considered (_k_) was (arbitrarily) set to 355. Chosen parameter values should orient on the absolute amount of data points and the \"severity\" of the visible measurement errors. Global outliers can be obtained for larger neighborhoods, while smaller neighborhoods are especially suitable to identify local outliers on a smaller spatial scale.\u003cbr/\u003e\n\nExecution time for 8.000 point observations: ~3 sec.\n\n## Demonstration:\u003cbr/\u003e\n\u003c!---  ![original_observations](img/original.png)\u003cbr/\u003e ---\u003e\n\u003c!---  ![cleansed_observations](img/processed.png)\u003cbr/\u003e ---\u003e\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"https://github.com/OliverHennhoefer/r-averaged-difference-algorithm/blob/master/img/original.png\" width=\"500\"\u003e\n  \u003cimg src=\"https://github.com/OliverHennhoefer/r-averaged-difference-algorithm/blob/master/img/processed.png\" width=\"500\"\u003e\n\u003c/p\u003e\u003cbr/\u003e\n\n\u003csup\u003e1\u003c/sup\u003e http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.101.9899\u0026rep=rep1\u0026type=pdf\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverhennhoefer%2Fr-averaged-difference-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverhennhoefer%2Fr-averaged-difference-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverhennhoefer%2Fr-averaged-difference-algorithm/lists"}