Skip to content

Conversation

@d-morrison
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 14, 2025 06:12
@d-morrison
Copy link
Owner Author

@copilot complete and polish the introduction to classification section

Copy link
Contributor

Copilot AI commented Nov 14, 2025

@d-morrison I've opened a new pull request, #266, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new section on classification to the probability document, introducing concepts related to positive predictive value through a COVID-19 testing example. The changes include a new classification chapter file, a macro definition for probability mass functions, and an update to gitignore.

  • Adds new classification.qmd file with positive predictive value calculations
  • Defines \pmf macro in macros.qmd for probability mass function notation
  • Updates .gitignore to exclude Quarto IPython notebook files

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 14 comments.

File Description
classification.qmd New file containing classification introduction and positive predictive value example with Bayesian calculations
probability.qmd Includes the new classification section in the probability document
macros.qmd Adds \pmf macro definition for probability mass function notation
.gitignore Adds pattern to ignore Quarto IPython notebook cache files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 19 to 50
$$\mass(A) = 0.07$$

$$\mass(\neg A) = .93$$



$p\left( negative \middle| no\ covid \right) = .99$:
$p\left( B \middle| !A \right)$

$$p\left( Covid \middle| positive \right) = ?$$

$$p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}$$

$$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$

$$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$

$$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$

$$p(B) = .0693 + .0093 = .0786$$

$$p\left( A \middle| B \right) = .0693/.0786$$

$$= .88$$

$${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$

$$= \frac{p(A)}{p(A) + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}p(!A)}$$

$$= \frac{1}{1 + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}\frac{p(!A)}{p(A)}}
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent notation. Earlier in the document, disease is represented as D (line 12), but here it's represented as A. The notation should be consistent throughout the document.

Suggested change
$$\mass(A) = 0.07$$
$$\mass(\neg A) = .93$$
$p\left( negative \middle| no\ covid \right) = .99$:
$p\left( B \middle| !A \right)$
$$p\left( Covid \middle| positive \right) = ?$$
$$p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}$$
$$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$
$$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$
$$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$
$$p(B) = .0693 + .0093 = .0786$$
$$p\left( A \middle| B \right) = .0693/.0786$$
$$= .88$$
$${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$
$$= \frac{p(A)}{p(A) + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}p(!A)}$$
$$= \frac{1}{1 + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}\frac{p(!A)}{p(A)}}
$$\mass(D) = 0.07$$
$$\mass(\neg D) = .93$$
$p\left( negative \middle| no\ covid \right) = .99$:
$p\left( B \middle| \neg D \right)$
$$p\left( Covid \middle| positive \right) = ?$$
$$p\left( D \middle| B \right) = \frac{p\left( B \middle| D \right)p(D)}{p(B)}$$
$$p(B) = p\left( B \middle| D \right)p(D) + p\left( B \middle| \neg D \right)p(\neg D)$$
$$p\left( B \middle| D \right)p(D) = .99*\ .07 = .0693$$
$$\ p\left( B \middle| \neg D \right)p(\neg D) = .01*.93 = .0093$$
$$p(B) = .0693 + .0093 = .0786$$
$$p\left( D \middle| B \right) = .0693/.0786$$
$$= .88$$
$${p\left( D \middle| B \right) = \frac{p\left( B \middle| D \right)p(D)}{p(B)}
}{= p\left( B \middle| D \right)\frac{p(D)}{p(B)}
}{= p\left( B \middle| D \right)\frac{p(D)}{p\left( B \middle| D \right)p(D) + p\left( B \middle| \neg D \right)p(\neg D)}}$$
$$= \frac{p(D)}{p(D) + \frac{p\left( B \middle| \neg D \right)}{p\left( B \middle| D \right)}p(\neg D)}$$
$$= \frac{1}{1 + \frac{p\left( B \middle| \neg D \right)}{p\left( B \middle| D \right)}\frac{p(\neg D)}{p(D)}}

Copilot uses AI. Check for mistakes.
Comment on lines 25 to 28
$p\left( negative \middle| no\ covid \right) = .99$:
$p\left( B \middle| !A \right)$

$$p\left( Covid \middle| positive \right) = ?$$
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent notation. Line 25 uses no\ covid (with escaped space), line 26 uses !A, and line 28 uses Covid. The notation should be consistent - either use the symbolic notation consistently (like \neg A or !A) or use descriptive text consistently.

Suggested change
$p\left( negative \middle| no\ covid \right) = .99$:
$p\left( B \middle| !A \right)$
$$p\left( Covid \middle| positive \right) = ?$$
$p\left( B \middle| \neg A \right) = .99$:
$p\left( B \middle| \neg A \right)$
$$p\left( A \middle| B \right) = ?$$

Copilot uses AI. Check for mistakes.

$$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$

$$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space before multiplication operator. Remove the space after the asterisk: should be .99 * .07 instead of .99*\ .07.

Suggested change
$$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$
$$p\left( B \middle| A \right)p(A) = .99 * .07 = .0693$$

Copilot uses AI. Check for mistakes.
$p\left( negative \middle| no\ covid \right) = .99$:
$p\left( B \middle| !A \right)$

$$p\left( Covid \middle| positive \right) = ?$$
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent disease reference. Line 17 mentions "covid" but line 28 switches to "Covid" (capitalized). The disease name should be consistently capitalized (typically "COVID-19" or just "disease" if keeping it generic).

Copilot uses AI. Check for mistakes.
Comment on lines 19 to 21
$$\mass(A) = 0.07$$

$$\mass(\neg A) = .93$$
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined notation \mass. This macro is used but not defined in macros.qmd, which could cause compilation errors. Consider using \pmf or defining the \mass macro.

Copilot uses AI. Check for mistakes.

$$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$

$$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leading space before equation. Remove the leading backslash-space: should be p\left( instead of \ p\left(.

Suggested change
$$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$
$$p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$

Copilot uses AI. Check for mistakes.
Comment on lines 44 to 46
$${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Malformed LaTeX equation. Lines 44-46 appear to be a single equation split incorrectly with multiple $$ delimiters. This should use proper multi-line equation formatting like \begin{align} or separate the steps into individual equations with text between them.

Suggested change
$${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$
$$
\begin{align*}
p\left( A \middle| B \right) &= \frac{p\left( B \middle| A \right)p(A)}{p(B)} \\
&= p\left( B \middle| A \right)\frac{p(A)}{p(B)} \\
&= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}
\end{align*}
$$

Copilot uses AI. Check for mistakes.
Comment on lines 12 to 50
$$\pmf{ + | D} = .99$$

99% specific means if they don't have covid, the test says no covid, 99%
time

7% of people actually have covid:

$$\mass(A) = 0.07$$

$$\mass(\neg A) = .93$$



$p\left( negative \middle| no\ covid \right) = .99$:
$p\left( B \middle| !A \right)$

$$p\left( Covid \middle| positive \right) = ?$$

$$p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}$$

$$p(B) = p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)$$

$$p\left( B \middle| A \right)p(A) = .99*\ .07 = .0693$$

$$\ p\left( B \middle| !A \right)p(!A) = .01*.93 = .0093$$

$$p(B) = .0693 + .0093 = .0786$$

$$p\left( A \middle| B \right) = .0693/.0786$$

$$= .88$$

$${p\left( A \middle| B \right) = \frac{p\left( B \middle| A \right)p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p(B)}
}{= p\left( B \middle| A \right)\frac{p(A)}{p\left( B \middle| A \right)p(A) + p\left( B \middle| !A \right)p(!A)}}$$

$$= \frac{p(A)}{p(A) + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}p(!A)}$$

$$= \frac{1}{1 + \frac{p\left( B \middle| !A \right)}{p\left( B \middle| A \right)}\frac{p(!A)}{p(A)}}
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent decimal notation. Throughout the document, probabilities are written as .99, .07, .93, etc. (without leading zero), but it would be clearer and more standard to use 0.99, 0.07, 0.93 for readability.

Copilot uses AI. Check for mistakes.
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Nov 14, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://d-morrison.github.io/rme/pr-preview/pr-265/

Built to branch gh-pages at 2025-11-14 08:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

d-morrison and others added 11 commits November 13, 2025 23:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
…ated notation

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Create classification appendix chapter with polished content
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