{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/using-perturbation-to-improve-goodness-of-fit","title":"Using Perturbation to Improve Goodness-of-Fit Tests based on Kernelized Stein Discrepancy","arxiv_id":"2304.14762","date":"2023-04-28","proceeding":null,"authors":["Xing Liu","Andrew B. Duncan","Axel Gandy"],"abstract":"Kernelized Stein discrepancy (KSD) is a score-based discrepancy widely used in goodness-of-fit tests. It can be applied even when the target distribution has an unknown normalising factor, such as in Bayesian analysis. We show theoretically and empirically that the KSD test can suffer from low power when the target and the alternative distributions have the same well-separated modes but differ in mixing proportions. We propose to perturb the observed sample via Markov transition kernels, with respect to which the target distribution is invariant. This allows us to then employ the KSD test on the perturbed sample. We provide numerical evidence that with suitably chosen transition kernels the proposed approach can lead to substantially higher power than the KSD test.","url_abs":"https://arxiv.org/abs/2304.14762v3","url_pdf":"https://arxiv.org/pdf/2304.14762v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"using-perturbation-to-improve-goodness-of-fit","repo_url":"https://github.com/xinglliu/pksd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2304.14762","atlas_url":"https://app.syntology.ai/?focus=2304.14762","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2304.14762"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/XingLLiu/pksd","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/xinglliu/pksd","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":16},"by_repo_kind":{"official":{"samples":16,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"48932edc3b597c09","entry":"compute_ksd","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/kgof/kernel.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/kgof/kernel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"48932edc3b597c09"}},{"code_sha256_prefix":"703b535ace0bba4b","entry":"create_mixture_gaussian_kdim_logprobb","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/models_np.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/models_np.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"703b535ace0bba4b"}},{"code_sha256_prefix":"01ab641d9bba2730","entry":"ksdagg_wild_custom","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/kgof/ksdagg.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/kgof/ksdagg.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"01ab641d9bba2730"}},{"code_sha256_prefix":"5ac1129cecb37805","entry":"l2norm","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/kernel.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/kernel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5ac1129cecb37805"}},{"code_sha256_prefix":"1e9f4edd607a92bd","entry":"logsumexp","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/models_np.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/models_np.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1e9f4edd607a92bd"}},{"code_sha256_prefix":"0e4dfe17d8b7d807","entry":"merge_modes","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/find_modes.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/find_modes.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0e4dfe17d8b7d807"}},{"code_sha256_prefix":"6a15096c15f4ca4e","entry":"multivariate_t_logprob","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/models_np.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/models_np.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6a15096c15f4ca4e"}},{"code_sha256_prefix":"b3810f48851c8037","entry":"norm2_sq","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/sensors.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/sensors.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3810f48851c8037"}},{"code_sha256_prefix":"c5325727ede27f6e","entry":"norm2_sq_np","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/sensors.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/sensors.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c5325727ede27f6e"}},{"code_sha256_prefix":"16fc88a882225eb1","entry":"pairwise_mahalanobis","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/find_modes.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/find_modes.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"16fc88a882225eb1"}},{"code_sha256_prefix":"fade3727070787f0","entry":"plot_sensors","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/sensors.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/sensors.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fade3727070787f0"}},{"code_sha256_prefix":"44916ebc94da1c8f","entry":"prepare_proposal_input","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/langevin.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/langevin.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"44916ebc94da1c8f"}},{"code_sha256_prefix":"f0eef89f6029121e","entry":"prepare_proposal_input_all","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/langevin.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/langevin.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f0eef89f6029121e"}},{"code_sha256_prefix":"afdccdc29f702ebf","entry":"ratio_ksd_stdev","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/kgof/kernel.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/kgof/kernel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"afdccdc29f702ebf"}},{"code_sha256_prefix":"ec8a35d4a6925338","entry":"stein_kernel_matrices","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/kgof/kernel.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/kgof/kernel.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ec8a35d4a6925338"}},{"code_sha256_prefix":"94592dc674f4f6a4","entry":"t_prob_fast","repo":"XingLLiu/pksd","repo_kind":"official","path":"pksd/models.py","file_url":"https://github.com/XingLLiu/pksd/blob/HEAD/pksd/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"94592dc674f4f6a4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}