{"id":23863147,"url":"https://github.com/cnuahs/hermans-rasson","last_synced_at":"2026-06-12T20:32:41.910Z","repository":{"id":84775062,"uuid":"168927203","full_name":"cnuahs/hermans-rasson","owner":"cnuahs","description":"The Hermans-Rasson test for non-uniformity of circular data.","archived":false,"fork":false,"pushed_at":"2020-11-23T10:43:16.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T12:30:41.939Z","etag":null,"topics":["circular-statistics","hermans-rasson","matlab","rayleigh-test","statistics"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","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/cnuahs.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":"2019-02-03T09:02:48.000Z","updated_at":"2022-03-01T21:21:49.000Z","dependencies_parsed_at":"2023-11-22T16:23:04.980Z","dependency_job_id":null,"html_url":"https://github.com/cnuahs/hermans-rasson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cnuahs/hermans-rasson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuahs%2Fhermans-rasson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuahs%2Fhermans-rasson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuahs%2Fhermans-rasson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuahs%2Fhermans-rasson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cnuahs","download_url":"https://codeload.github.com/cnuahs/hermans-rasson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnuahs%2Fhermans-rasson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34262155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["circular-statistics","hermans-rasson","matlab","rayleigh-test","statistics"],"created_at":"2025-01-03T07:47:36.708Z","updated_at":"2026-06-12T20:32:41.884Z","avatar_url":"https://github.com/cnuahs.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![View A Matlab implementation of the Hermans-Rasson test on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://au.mathworks.com/matlabcentral/fileexchange/70185-a-matlab-implementation-of-the-hermans-rasson-test)\n\n# hermans-rasson\n\nA Matlab implementation of the Hermans-Rasson test for non-uniformity of circular data. The test is described in:\n\n  Hermans M, Rasson J. (1985). A new Sobolev test for uniformity on the circle. Biometrika. 72:698–702. doi: 10.1093/biomet/72.3.698.\n\nThe Hermans-Rasson test can provide additional power (c.f. the Rayleigh test, for example) to reject the hypothesis of uniformity in cases where the distribution is multi-modal with unknown symmetry.\n\nExample usage:\n```\n% multi-modal circular distribution, sum of von Mises distributions\nkappa = [3 6];\nxbar = [0 5*pi/6];\n\nnsamp = round(logspace(1,3,10)); % number of samples\n\nN = 1e3; % number of bootstrap samples\n\nx = linspace(-pi,pi,361);\n\nn = numel(kappa);\nfor ii = 1:n\n  pdf(:,ii) = (2*pi/360)*circ_vmpdf(x(:), xbar(ii), kappa(ii))./n;\nend\n\n% plot pdfs\nfigure\nsubplot(1,2,1);\nplot(x,pdf,'k-'); hold on\n\npdf = sum(pdf,2);\n\nplot(x,pdf,'k-','LineWidth',1.5);\n\nxlim(pi*[-1,1]);\n\n% sample from the distribution\np = NaN([N,length(nsamp)]);\nprayleigh = NaN([N,length(nsamp)]);\nfor ii = 1:length(nsamp)\n  xhat = NaN([nsamp(ii),N]);\n  for jj = 1:N\n    xhat(:,jj) = randsample(x,nsamp(ii),true,pdf);\n\n    prayleigh(jj,ii) = circ_rtest(xhat(:,jj));\n  end\n\n  p(:,ii) = hrtest(xhat);\nend\n\n% plot p(H0) vs nsamp\nsubplot(1,2,2);\nsemilogx(nsamp,mean(p),'ko-','LineWidth',1.5,'MarkerFaceColor','k'); hold on\nsemilogx(nsamp,mean(prayleigh),'k.-');\n```\n\nThe example above uses `circ_vmpdf()` and `circ_rtest()` from Philipp Berens Circular Statstics Toolbox for Matlab, available from https://github.com/circstat/circstat-matlab.git. The output should look something like:\n![hermans-rasson vs rayleigh test](./images/example.png \"Hermans-Rasson vs Rayleigh test\")\n\nFor a comparison of several tests for non-uniformity and some recommendations on their relative merits, see:\n\n  Landler L, Ruxton GD, Malkemper EP. (2018). Circular data in biology: advice for effectively implementing statistical procedures. Behavioral ecology and sociobiology. 72(8) 128. doi: 10.1007/s00265-018-2538-y.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnuahs%2Fhermans-rasson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcnuahs%2Fhermans-rasson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnuahs%2Fhermans-rasson/lists"}