Skip to content

Add the Laplace distribution - #75

Open
d-morrison wants to merge 4 commits into
mainfrom
claude/project-thread-793ajb
Open

d-morrison wants to merge 4 commits into
mainfrom
claude/project-thread-793ajb

Conversation

@d-morrison

Copy link
Copy Markdown
Contributor

Before: pds had no Laplace distribution, so the lasso as a MAP estimate under a Laplace prior (lds regularization) had nothing to link to.

After: the distributions page has a Laplace section with the definition (#def-laplace, #eq-laplace-pdf), a theorem and proof for its mean and variance (#thm-laplace-moments), and a worked example (#exm-laplace-vs-normal) with a figure (#fig-laplace-vs-normal) comparing Laplace and normal densities with equal mean and variance. The tail probabilities and their ratio in the example are computed from R, not typed.

How: three new fragments in _subfiles/, included in _sec-distributions.qmd before the Weibull section as #sec-laplace. dLaplacef is added to inst/WORDLIST. Rendered distributions.qmd locally and checked that each new id appears once.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TCQ3dTUAunddrUWa3yTgyJ


Generated by Claude Code

claude added 2 commits October 8, 2026 07:11
Defines the Laplace density, proves its mean and variance, and compares
its tails with the normal using a figure and computed numbers. This is
the prior that makes the lasso a MAP estimate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCQ3dTUAunddrUWa3yTgyJ
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…n remark

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCQ3dTUAunddrUWa3yTgyJ
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Claude finished review — View run


This file is clean and the sentence reads correctly after the edit.

Review of commit 96a54c10 ("Remove the forward reference to the Laplace figure from the definition remark")

This is the only unreviewed commit since the last round (aa53b23a). It touches a single file, _subfiles/_def-laplace.qmd, removing the parenthetical (see @fig-laplace-vs-normal) from the closing remark and re-joining the sentence with a period.

Correctness of the fix:

  • Confirmed via _subfiles/_sec-distributions.qmd:809-825 that @fig-laplace-vs-normal is defined inside _exm-laplace-vs-normal.qmd, which is included two {{< slidebreak >}} sections after _def-laplace.qmd (order: def → density example → moments theorem → vs-normal example/figure). The removed parenthetical was a genuine forward reference to a figure not yet introduced at that point in the document — exactly the anti-pattern the lab's fix-forward-references convention targets. Deleting it rather than reordering sections is the right call here, since the figure naturally belongs with the tail-comparison example, not the definition.
  • The resulting sentence (_subfiles/_def-laplace.qmd:17) is grammatically complete and reads correctly standalone: "...but the Laplace density has a sharp peak at $\mu$ and decays more slowly in the tails." No dangling clause, no broken punctuation.
  • No other file references the removed parenthetical or depends on it; @fig-laplace-vs-normal remains validly defined and referenced only within _exm-laplace-vs-normal.qmd itself, which is unaffected by this commit.

Scope/build hygiene: Single-file, 1-insertion/2-deletion diff, matching the reported stat exactly. No _site//_freeze/ changes, no WORDLIST changes needed (no new tokens).

This commit is clean and does not change the standing verdict from the prior rounds. The two previously-noted non-blocking observations — inst/WORDLIST's alphabetical ordering and Laplace's absence from tbl-outcome-distns — remain unaffected by this change and still stand as optional, non-blocking suggestions from the 2026-10-08T07:20:28Z review.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "96a54c1060db5230b7d07a503e16873058c6a7c8",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Verified in _subfiles/_sec-distributions.qmd that the removed @fig-laplace-vs-normal mention in _def-laplace.qmd was a genuine forward reference to content included two sections later, so deleting it fixes a real ordering defect without leaving a dangling or broken sentence.",
  "holistic_assessment": "Single-file one-sentence edit stays within the PR's stated scope, introduces no regression to cross-reference resolution or build hygiene, and leaves the two prior non-blocking suggestions (WORDLIST ordering, outcome-distributions table) unaffected and still optional."
}

Reviewed commit: 96a54c1

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

💰 Cost: $0.2327 (review) — run

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Morrison-Lab.github.io/pds/pr-preview/pr-75/

Built to branch gh-pages at 2026-10-08 02:09 PDT.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants