[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CCQ8RZPFKJ0ZB4H96X68XR":3,"skill-same:01M7CCQ8RZPFKJ0ZB4H96X68XR":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CCQ8RZPFKJ0ZB4H96X68XR","bayesian-anomaly-detection",null,"Flag anomalies and outliers in data using Bayesian inference. Use when the user asks to \"flag the anomalies in this data\", \"which points are outliers\", \"find the anomalies\", \"flag outliers\", \"clean my data of outliers\", \"detect anomalies\", \"robust fit ignoring outliers\", \"mitigate RFI\", \"handle contaminated data\", \"anomaly detection\", \"outlier detection\", or mentions flagging bad data points, anomaly-corrected likelihood, or epsilon mask.","shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Ffundamental-physics__marketplace__plugins__astro-ph.CO__skills__bayesian-anomaly-detection\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bayesian-anomaly-detection\ndescription: Flag anomalies and outliers in data using Bayesian inference. Use when the user asks to \"flag the anomalies in this data\", \"which points are outliers\", \"find the anomalies\", \"flag outliers\", \"clean my data of outliers\", \"detect anomalies\", \"robust fit ignoring outliers\", \"mitigate RFI\", \"handle contaminated data\", \"anomaly detection\", \"outlier detection\", or mentions flagging bad data points, anomaly-corrected likelihood, or epsilon mask.\n---\n\n# Bayesian Anomaly Detection\n\n## Overview\n\nIdentify anomalies in any dataset by jointly inferring model parameters and per-point anomaly probabilities. Rather than pre-processing to remove outliers, this method modifies your likelihood function so that the sampler **automatically determines how likely each data point is to be anomalous** and returns robust parameter estimates.\n\n**What you get:** For each data point, a continuous probability of being anomalous (e.g. 0.02 = almost certainly clean, 0.95 = almost certainly anomalous). These are not binary classifications -- they are posterior probabilities from the weighted mean over the epsilon mask, capturing genuine uncertainty about borderline points. For your model parameters, unbiased estimates even when the data contains outliers.\n\nKey features:\n- **Continuous anomaly probabilities**: Each data point gets a probability of being anomalous, not a hard yes\u002Fno\n- **Model-agnostic**: Works with any likelihood-based inference (linear regression, spectral fitting, cosmological parameter estimation, etc.)\n- **Minimal code changes**: Only 3 lines modify a standard likelihood function\n- **No manual thresholds**: The data and model jointly determine anomaly probabilities\n\n## Workflow Position\n\nThis skill provides components **(2) Science** and **(3) Inference** in the physics workflow:\n\n```\n(1) Research\u002FBrainstorm -> (2) Science -> (3) Inference -> (4) Visualization\n```\n\n**Inputs:** Any dataset with potential outliers\u002Fanomalies and a parametric model\n**Outputs:** Per-point anomaly probabilities and robust parameter estimates\n\nConnects to any sampler (MCMC, nested sampling, optimisation).\n\n## Mathematical Framework\n\n### Binary Anomaly Mask\n\nIntroduce a binary anomaly mask $\\varepsilon_i$ for each data point $i$:\n\n$$\\varepsilon_i = \\begin{cases} 0 & \\text{if data point } i \\text{ is expected} \\\\ 1 & \\text{if data point } i \\text{ is anomalous} \\end{cases}$$\n\n### Bernoulli Prior\n\nEach mask element follows a Bernoulli prior:\n\n$$P(\\varepsilon_i) = p^{\\varepsilon_i} (1-p)^{1-\\varepsilon_i}$$\n\nwhere $p$ is the prior probability that any given data point is anomalous. This can be fixed or treated as a free parameter (recommended).\n\n### Piecewise Likelihood\n\nThe joint likelihood over data and anomaly masks:\n\n$$P(D, \\varepsilon | \\theta) = \\prod_{i=1}^N \\left[ \\mathcal{L}_i(\\theta)(1-p) \\right]^{1-\\varepsilon_i} \\left[ \\frac{p}{\\Delta} \\right]^{\\varepsilon_i}$$\n\nwhere:\n- $\\mathcal{L}_i(\\theta)$ is the standard likelihood for data point $i$\n- $\\Delta$ is a normalisation constant (data range scale)\n- Anomalous points contribute a flat likelihood $p\u002F\\Delta$\n\n### Max-Approximation for Marginalisation\n\nMarginalising over all $2^N$ possible mask configurations is intractable. The key insight is to approximate by taking the **most likely mask** for each parameter set $\\theta$. This reduces to a simple per-point maximum:\n\n$$\\log P(D|\\theta) \\approx \\sum_{i=1}^N \\max\\!\\Big(\\log \\mathcal{L}_i + \\log(1-p),\\;\\; \\log p - \\log \\Delta\\Big)$$\n\nThis is the **anomaly-corrected log-likelihood**. Each data point either contributes its normal likelihood (if consistent with the model) or a flat anomaly penalty (if it is an outlier). The transition is automatic and determined by the data.\n\n## Quick Start: Linear Regression with Outliers\n\n### 1. Generate Data with Anomalies\n\n```python\nimport numpy as np\n\nnp.random.seed(123)\nN = 25\nx = np.linspace(0, 25, N)\nm_true, c_true, sig_true = 1.0, 1.0, 2.0\ny = m_true * x + c_true + np.random.randn(N) * sig_true\n\n# Inject two anomalies\ny[10] += 100\ny[15] += 100\n```\n\n### 2. Standard Likelihood (No Anomaly Correction)\n\n```python\ndef log_likelihood_standard(theta, x, y):\n    m, c, sig = theta[0], theta[1], theta[2]\n    sig = max(sig, 1e-6)\n    y_pred = m * x + c\n    logL = -0.5 * ((y_pred - y)**2) \u002F sig**2 - 0.5 * np.log(2 * np.pi * sig**2)\n    return logL.sum()\n```\n\n### 3. Anomaly-Corrected Likelihood (The Key Modification)\n\nOnly three lines differ from the standard likelihood:\n\n```python\ndef log_likelihood_anomaly(theta, x, y, delta):\n    m, c, sig, logp = theta[0], theta[1], theta[2], theta[3]\n    sig = max(sig, 0.1)\n    p = np.exp(np.clip(logp, -20, -0.1))\n    y_pred = m * x + c\n\n    # Standard per-point log-likelihood\n    logL_normal = -0.5 * ((y_pred - y)**2) \u002F sig**2 - 0.5 * np.log(2 * np.pi * sig**2)\n\n    # --- Three key lines ---\n    logL_with_prior = logL_normal + np.log(1 - p)          # weight by P(not anomaly)\n    anomaly_threshold = logp - np.log(delta)                # flat anomaly likelihood\n    logL_corrected = np.maximum(logL_with_prior, anomaly_threshold)  # per-point max\n\n    return logL_corrected.sum()\n```\n\nSet `delta = np.max(y)` (data range scale) and sample `logp` as a free parameter with prior $\\log p \\in [-10, -0.1]$.\n\n### 4. MCMC Sampling\n\n```python\ndef run_mcmc(log_likelihood, n_params, n_samples=5000, n_burn=1000):\n    samples = np.zeros((n_samples, n_params))\n    current = np.array([1.0, 1.0, 2.0, -3.0])[:n_params]\n    current_logL = log_likelihood(current)\n    step_size = 0.1\n    bounds_lo = np.array([-2, -20, 0.1, -10])[:n_params]\n    bounds_hi = np.array([4, 20, 20, -0.1])[:n_params]\n\n    for i in range(n_samples + n_burn):\n        proposal = current + np.random.normal(0, step_size, n_params)\n        proposal = np.clip(proposal, bounds_lo, bounds_hi)\n        proposal_logL = log_likelihood(proposal)\n\n        if np.random.rand() \u003C np.exp(min(0, proposal_logL - current_logL)):\n            current, current_logL = proposal, proposal_logL\n\n        if i >= n_burn:\n            samples[i - n_burn] = current\n\n    return samples\n\ndelta = np.max(y)\nsamples_std = run_mcmc(lambda t: log_likelihood_standard(t, x, y), 3)\nsamples_anom = run_mcmc(lambda t: log_likelihood_anomaly(t, x, y, delta), 4)\n\nprint(f\"Standard:  m={samples_std[:,0].mean():.2f}, c={samples_std[:,1].mean():.2f}, \"\n      f\"sig={samples_std[:,2].mean():.2f}\")\nprint(f\"Corrected: m={samples_anom[:,0].mean():.2f}, c={samples_anom[:,1].mean():.2f}, \"\n      f\"sig={samples_anom[:,2].mean():.2f}\")\n```\n\nThe anomaly-corrected fit recovers the true parameters ($m=1$, $c=1$, $\\sigma=2$) even with extreme outliers, while the standard fit is severely biased.\n\n### 5. Posterior Anomaly Probabilities\n\nTrack the epsilon mask across posterior samples to get a continuous probability that each data point is anomalous:\n\n```python\ndef log_likelihood_with_mask(theta, x, y, delta):\n    m, c, sig, logp = theta[0], theta[1], theta[2], theta[3]\n    sig = max(sig, 0.1)\n    p = np.exp(np.clip(logp, -20, -0.1))\n    y_pred = m * x + c\n    logL_normal = -0.5 * ((y_pred - y)**2) \u002F sig**2 - 0.5 * np.log(2 * np.pi * sig**2)\n    logL_with_prior = logL_normal + np.log(1 - p)\n    anomaly_threshold = logp - np.log(delta)\n    logL_corrected = np.maximum(logL_with_prior, anomaly_threshold)\n    epsilon_mask = (logL_with_prior \u003C anomaly_threshold).astype(int)\n    return logL_corrected.sum(), epsilon_mask\n\n# Collect masks during sampling, then compute weighted mean:\nposterior_fraction = np.average(epsilon_masks, weights=weights, axis=0)\n# For equally-weighted MCMC samples, weights = np.ones(n_samples)\n# For nested sampling, use the posterior weights from the sampler\n```\n\nPoints 10 and 15 will have high anomaly probabilities (near 1.0), while clean data points will have low probabilities (near 0.0). Borderline points will have intermediate values, reflecting genuine uncertainty.\n\n## How to Get Anomaly Probabilities for Your Data\n\nThe recipe for any model:\n\n1. **Start with your existing likelihood** that computes per-point `logL_normal[i]`\n2. **Set `delta`** to the scale of your data (e.g., `np.max(np.abs(y))`)\n3. **Add `logp` as a free parameter** with prior $\\log p \\in [-10, -0.1]$\n4. **Add three lines** to your likelihood:\n   ```python\n   logL_with_prior = logL_normal + np.log(1 - p)\n   anomaly_threshold = logp - np.log(delta)\n   logL_corrected = np.maximum(logL_with_prior, anomaly_threshold)\n   ```\n5. **Run your sampler** (MCMC, nested sampling, etc.) and collect the epsilon mask at each sample\n6. **Compute the posterior anomaly probability** for each data point:\n   ```python\n   anomaly_prob = np.average(epsilon_masks, weights=weights, axis=0)\n   # anomaly_prob[i] near 1 → probably anomalous\n   # anomaly_prob[i] near 0 → probably clean\n   # intermediate values → genuine uncertainty\n   ```\n\nThis works for any model: spectral fitting, radio frequency interference mitigation, cosmological parameter estimation, time series analysis, or any parametric model with potential outliers.\n\nFor large datasets with many anomalies, see Anstey & Leeney (2023) for likelihood reweighting methods achieving ~25x speedup.\n\n## Citation\n\nIf you use this method, please cite:\n\n```bibtex\n@article{Leeney2023,\n    author = {Leeney, Samuel K. and Handley, William J. and Sherrill, Bradley and Sherrill, Neil},\n    title = \"{Bayesian approach to radio frequency interference mitigation}\",\n    journal = {Physical Review D},\n    volume = {108},\n    number = {6},\n    pages = {062006},\n    year = {2023},\n    doi = {10.1103\u002FPhysRevD.108.062006},\n    eprint = {2211.15448},\n    archivePrefix = {arXiv},\n    primaryClass = {astro-ph.CO}\n}\n\n@article{AnsteyLeeney2023,\n    author = {Anstey, Dominic and Leeney, Samuel K.},\n    title = \"{Enhanced Bayesian RFI Mitigation and Transient Flagging Using Likelihood Reweighting}\",\n    year = {2023},\n    eprint = {2310.02146},\n    archivePrefix = {arXiv},\n    primaryClass = {astro-ph.IM}\n}\n```\n\n## Bundled Scripts\n\n- **bayesian_anomaly_detection_example.py**: Self-contained demo comparing standard vs anomaly-corrected inference on linear regression with injected outliers. Pure numpy, no external dependencies.\n  ```bash\n  python bayesian_anomaly_detection_example.py\n  ```\n","# Bayesian Anomaly Detection\n\n## Overview\n\nIdentify anomalies in any dataset by jointly inferring model parameters and per-point anomaly probabilities. Rather than pre-processing to remove outliers, this method modifies your likelihood function so that the sampler **automatically determines how likely each data point is to be anomalous** and returns robust parameter estimates.\n\n**What you get:** For each data point, a continuous probability of being anomalous (e.g. 0.02 = almost certainly clean, 0.95 = almost certainly anomalous). These are not binary classifications -- they are posterior probabilities from the weighted mean over the epsilon mask, capturing genuine uncertainty about borderline points. For your model parameters, unbiased estimates even when the data contains outliers.\n\nKey features:\n- **Continuous anomaly probabilities**: Each data point gets a probability of being anomalous, not a hard yes\u002Fno\n- **Model-agnostic**: Works with any likelihood-based inference (linear regression, spectral fitting, cosmological parameter estimation, etc.)\n- **Minimal code changes**: Only 3 lines modify a standard likelihood function\n- **No manual thresholds**: The data and model jointly determine anomaly probabilities\n\n## Workflow Position\n\nThis skill provides components **(2) Science** and **(3) Inference** in the physics workflow:\n\n```\n(1) Research\u002FBrainstorm -> (2) Science -> (3) Inference -> (4) Visualization\n```\n\n**Inputs:** Any dataset with potential outliers\u002Fanomalies and a parametric model\n**Outputs:** Per-point anomaly probabilities and robust parameter estimates\n\nConnects to any sampler (MCMC, nested sampling, optimisation).\n\n## Mathematical Framework\n\n### Binary Anomaly Mask\n\nIntroduce a binary anomaly mask $\\varepsilon_i$ for each data point $i$:\n\n$$\\varepsilon_i = \\begin{cases} 0 & \\text{if data point } i \\text{ is expected} \\\\ 1 & \\text{if data point } i \\text{ is anomalous} \\end{cases}$$\n\n### Bernoulli Prior\n\nEach mask element follows a Bernoulli prior:\n\n$$P(\\varepsilon_i) = p^{\\varepsilon_i} (1-p)^{1-\\varepsilon_i}$$\n\nwhere $p$ is the prior probability that any given data point is anomalous. This can be fixed or treated as a free parameter (recommended).\n\n### Piecewise Likelihood\n\nThe joint likelihood over data and anomaly masks:\n\n$$P(D, \\varepsilon | \\theta) = \\prod_{i=1}^N \\left[ \\mathcal{L}_i(\\theta)(1-p) \\right]^{1-\\varepsilon_i} \\left[ \\frac{p}{\\Delta} \\right]^{\\varepsilon_i}$$\n\nwhere:\n- $\\mathcal{L}_i(\\theta)$ is the standard likelihood for data point $i$\n- $\\Delta$ is a normalisation constant (data range scale)\n- Anomalous points contribute a flat likelihood $p\u002F\\Delta$\n\n### Max-Approximation for Marginalisation\n\nMarginalising over all $2^N$ possible mask configurations is intractable. The key insight is to approximate by taking the **most likely mask** for each parameter set $\\theta$. This reduces to a simple per-point maximum:\n\n$$\\log P(D|\\theta) \\approx \\sum_{i=1}^N \\max\\!\\Big(\\log \\mathcal{L}_i + \\log(1-p),\\;\\; \\log p - \\log \\Delta\\Big)$$\n\nThis is the **anomaly-corrected log-likelihood**. Each data point either contributes its normal likelihood (if consistent with the model) or a flat anomaly penalty (if it is an outlier). The transition is automatic and determined by the data.\n\n## Quick Start: Linear Regression with Outliers\n\n### 1. Generate Data with Anomalies\n\n```python\nimport numpy as np\n\nnp.random.seed(123)\nN = 25\nx = np.linspace(0, 25, N)\nm_true, c_true, sig_true = 1.0, 1.0, 2.0\ny = m_true * x + c_true + np.random.randn(N) * sig_true\n\n# Inject two anomalies\ny[10] += 100\ny[15] += 100\n```\n\n### 2. Standard Likelihood (No Anomaly Correction)\n\n```python\ndef log_likelihood_standard(theta, x, y):\n    m, c, sig = theta[0], theta[1], theta[2]\n    sig = max(sig, 1e-6)\n    y_pred = m * x + c\n    logL = -0.5 * ((y_pred - y)**2) \u002F sig**2 - 0.5 * np.log(2 * np.pi * sig**2)\n    return logL.sum()\n```\n\n### 3. Anomaly-Corrected Likelihood (The Key Modification)\n\nOnly three lines differ from the standard likelihood:\n\n```python\ndef log_likelihood_anomaly(theta, x, y, delta):\n    m, c, sig, logp = theta[0], theta[1], theta[2], theta[3]\n    sig = max(sig, 0.1)\n    p = np.exp(np.clip(logp, -20, -0.1))\n    y_pred = m * x + c\n\n    # Standard per-point log-likelihood\n    logL_normal = -0.5 * ((y_pred - y)**2) \u002F sig**2 - 0.5 * np.log(2 * np.pi * sig**2)\n\n    # --- Three key lines ---\n    logL_with_prior = logL_normal + np.log(1 - p)          # weight by P(not anomaly)\n    anomaly_threshold = logp - np.log(delta)                # flat anomaly likelihood\n    logL_corrected = np.maximum(logL_with_prior, anomaly_threshold)  # per-point max\n\n    return logL_corrected.sum()\n```\n\nSet `delta = np.max(y)` (data range scale) and sample `logp` as a free parameter with prior $\\log p \\in [-10, -0.1]$.\n\n### 4. MCMC Sampling\n\n```python\ndef run_mcmc(log_likelihood, n_params, n_samples=5000, n_burn=1000):\n    samples = np.zeros((n_samples, n_params))\n    current = np.array([1.0, 1.0, 2.0, -3.0])[:n_params]\n    current_logL = log_likelihood(current)\n    step_size = 0.1\n    bounds_lo = np.array([-2, -20, 0.1, -10])[:n_params]\n    bounds_hi = np.array([4, 20, 20, -0.1])[:n_params]\n\n    for i in range(n_samples + n_burn):\n        proposal = current + np.random.normal(0, step_size, n_params)\n        proposal = np.clip(proposal, bounds_lo, bounds_hi)\n        proposal_logL = log_likelihood(proposal)\n\n        if np.random.rand() \u003C np.exp(min(0, proposal_logL - current_logL)):\n            current, current_logL = proposal, proposal_logL\n\n        if i >= n_burn:\n            samples[i - n_burn] = current\n\n    return samples\n\ndelta = np.max(y)\nsamples_std = run_mcmc(lambda t: log_likelihood_standard(t, x, y), 3)\nsamples_anom = run_mcmc(lambda t: log_likelihood_anomaly(t, x, y, delta), 4)\n\nprint(f\"Standard:  m={samples_std[:,0].mean():.2f}, c={samples_std[:,1].mean():.2f}, \"\n      f\"sig={samples_std[:,2].mean():.2f}\")\nprint(f\"Corrected: m={samples_anom[:,0].mean():.2f}, c={samples_anom[:,1].mean():.2f}, \"\n      f\"sig={samples_anom[:,2].mean():.2f}\")\n```\n\nThe anomaly-corrected fit recovers the true parameters ($m=1$, $c=1$, $\\sigma=2$) even with extreme outliers, while the standard fit is severely biased.\n\n### 5. Posterior Anomaly Probabilities\n\nTrack the epsilon mask across posterior samples to get a continuous probability that each data point is anomalous:\n\n```python\ndef log_likelihood_with_mask(theta, x, y, delta):\n    m, c, sig, logp = theta[0], theta[1], theta[2], theta[3]\n    sig = max(sig, 0.1)\n    p = np.exp(np.clip(logp, -20, -0.1))\n    y_pred = m * x + c\n    logL_normal = -0.5 * ((y_pred - y)**2) \u002F sig**2 - 0.5 * np.log(2 * np.pi * sig**2)\n    logL_with_prior = logL_normal + np.log(1 - p)\n    anomaly_threshold = logp - np.log(delta)\n    logL_corrected = np.maximum(logL_with_prior, anomaly_threshold)\n    epsilon_mask = (logL_with_prior \u003C anomaly_threshold).astype(int)\n    return logL_corrected.sum(), epsilon_mask\n\n# Collect masks during sampling, then compute weighted mean:\nposterior_fraction = np.average(epsilon_masks, weights=weights, axis=0)\n# For equally-weighted MCMC samples, weights = np.ones(n_samples)\n# For nested sampling, use the posterior weights from the sampler\n```\n\nPoints 10 and 15 will have high anomaly probabilities (near 1.0), while clean data points will have low probabilities (near 0.0). Borderline points will have intermediate values, reflecting genuine uncertainty.\n\n## How to Get Anomaly Probabilities for Your Data\n\nThe recipe for any model:\n\n1. **Start with your existing likelihood** that computes per-point `logL_normal[i]`\n2. **Set `delta`** to the scale of your data (e.g., `np.max(np.abs(y))`)\n3. **Add `logp` as a free parameter** with prior $\\log p \\in [-10, -0.1]$\n4. **Add three lines** to your likelihood:\n   ```python\n   logL_with_prior = logL_normal + np.log(1 - p)\n   anomaly_threshold = logp - np.log(delta)\n   logL_corrected = np.maximum(logL_with_prior, anomaly_threshold)\n   ```\n5. **Run your sampler** (MCMC, nested sampling, etc.) and collect the epsilon mask at each sample\n6. **Compute the posterior anomaly probability** for each data point:\n   ```python\n   anomaly_prob = np.average(epsilon_masks, weights=weights, axis=0)\n   # anomaly_prob[i] near 1 → probably anomalous\n   # anomaly_prob[i] near 0 → probably clean\n   # intermediate values → genuine uncertainty\n   ```\n\nThis works for any model: spectral fitting, radio frequency interference mitigation, cosmological parameter estimation, time series analysis, or any parametric model with potential outliers.\n\nFor large datasets with many anomalies, see Anstey & Leeney (2023) for likelihood reweighting methods achieving ~25x speedup.\n\n## Citation\n\nIf you use this method, please cite:\n\n```bibtex\n@article{Leeney2023,\n    author = {Leeney, Samuel K. and Handley, William J. and Sherrill, Bradley and Sherrill, Neil},\n    title = \"{Bayesian approach to radio frequency interference mitigation}\",\n    journal = {Physical Review D},\n    volume = {108},\n    number = {6},\n    pages = {062006},\n    year = {2023},\n    doi = {10.1103\u002FPhysRevD.108.062006},\n    eprint = {2211.15448},\n    archivePrefix = {arXiv},\n    primaryClass = {astro-ph.CO}\n}\n\n@article{AnsteyLeeney2023,\n    author = {Anstey, Dominic and Leeney, Samuel K.},\n    title = \"{Enhanced Bayesian RFI Mitigation and Transient Flagging Using Likelihood Reweighting}\",\n    year = {2023},\n    eprint = {2310.02146},\n    archivePrefix = {arXiv},\n    primaryClass = {astro-ph.IM}\n}\n```\n\n## Bundled Scripts\n\n- **bayesian_anomaly_detection_example.py**: Self-contained demo comparing standard vs anomaly-corrected inference on linear regression with injected outliers. Pure numpy, no external dependencies.\n  ```bash\n  python bayesian_anomaly_detection_example.py\n  ```\n",{"name":5,"description":7},"main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Ffundamental-physics__marketplace__plugins__astro-ph.CO__skills__bayesian-anomaly-detection","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add shenyimings\u002Fskillet --skill bayesian-anomaly-detection",{"tool":38,"command":39},"bunx","bunx skills add shenyimings\u002Fskillet --skill bayesian-anomaly-detection",{"tool":41,"command":42},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill bayesian-anomaly-detection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Ffundamental-physics__marketplace__plugins__astro-ph.CO__skills__bayesian-anomaly-detection\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"scripts\u002Fbayesian_anomaly_detection_example.py","SCRIPT","脚本",3873,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Ffundamental-physics__marketplace__plugins__astro-ph.CO__skills__bayesian-anomaly-detection\u002Fscripts\u002Fbayesian_anomaly_detection_example.py",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]