Skip to content

Commit 373c04c

Browse files
committed
Committing changes to workflow for r rendering
documents/BoosStefanskiQMD/chapters/ch5.qmd
1 parent 7f8cb0a commit 373c04c

2 files changed

Lines changed: 28 additions & 10 deletions

File tree

.github/workflows/jekyll.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,36 @@ jobs:
1818
build_and_deploy:
1919
runs-on: ubuntu-latest
2020
steps:
21-
# 1. Check out the repo
21+
# 1. Check out the repo (with fetch-depth 2 to detect changes)
2222
- name: Checkout
2323
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 2
26+
27+
# 2. Detect if BoosStefanskiQMD folder has changes
28+
- name: Check for BoosStefanskiQMD changes
29+
id: check_boosstefanski
30+
run: |
31+
if git diff --name-only HEAD~1 HEAD -- 'documents/BoosStefanskiQMD/' | grep -q .; then
32+
echo "changed=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "changed=false" >> $GITHUB_OUTPUT
35+
fi
2436
25-
# 2. Install Quarto
37+
# 3. Install Quarto
2638
- name: Setup Quarto
2739
uses: quarto-dev/quarto-actions/setup@v2
2840

29-
# 3. Install R
41+
# 4. Install R (only if BoosStefanskiQMD changed)
3042
- name: Setup R
43+
if: steps.check_boosstefanski.outputs.changed == 'true'
3144
uses: r-lib/actions/setup-r@v2
3245
with:
3346
r-version: '4.4.1'
3447

35-
# 4. Install R package dependencies
48+
# 5. Install R package dependencies (only if BoosStefanskiQMD changed)
3649
- name: Install R packages
50+
if: steps.check_boosstefanski.outputs.changed == 'true'
3751
run: |
3852
# Install system dependencies commonly needed by R packages
3953
sudo apt-get update
@@ -46,8 +60,9 @@ jobs:
4660
Rscript -e 'install.packages(c("knitr", "rmarkdown", "tidyverse", "ggplot2", "kableExtra", "numDeriv"), repos = "https://cloud.r-project.org")'
4761
fi
4862
49-
# 5. Render the Boos & Stefanski Quarto project to HTML
63+
# 6. Render the Boos & Stefanski Quarto project to HTML (only if BoosStefanskiQMD changed)
5064
- name: Render Boos and Stefanski QMD
65+
if: steps.check_boosstefanski.outputs.changed == 'true'
5166
run: |
5267
cd documents/BoosStefanskiQMD
5368
quarto render --output-dir _output
@@ -57,24 +72,24 @@ jobs:
5772
mkdir -p documents/BoosStefanski
5873
cp -r documents/BoosStefanskiQMD/_output/* documents/BoosStefanski/
5974
60-
# 6. Setup Ruby and install gems (for jekyll-scholar, etc.)
75+
# 7. Setup Ruby and install gems (for jekyll-scholar, etc.)
6176
- name: Setup Ruby
6277
uses: ruby/setup-ruby@v1
6378
with:
6479
ruby-version: '3.2'
6580
bundler-cache: true
6681

67-
# 7. Configure GitHub Pages
82+
# 8. Configure GitHub Pages
6883
- name: Configure Pages
6984
uses: actions/configure-pages@v5
7085

71-
# 8. Build the Jekyll site
86+
# 9. Build the Jekyll site
7287
- name: Build with Jekyll
7388
run: bundle exec jekyll build --baseurl ""
7489
env:
7590
JEKYLL_ENV: production
7691

77-
# 9. Upload the built site as a Pages artifact
92+
# 10. Upload the built site as a Pages artifact
7893
- name: Upload artifact
7994
uses: actions/upload-pages-artifact@v3
8095

documents/BoosStefanskiQMD/chapters/ch5.qmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,11 @@ g((\bar X, \bar Y)^T) - g((\mu_1,\mu_2)^T) &= \begin{pmatrix} \bar X - \mu_1 \
255255
\end{aligned}$$
256256
Thus, in the case where $\mu_1=\mu_2= 0$
257257
$$\begin{aligned}
258+
T &= \bar X \bar Y - 0\\
258259
g((\bar X, \bar Y)^T) - g((0,0)^T) &= \begin{pmatrix} \bar X & \bar Y \end{pmatrix} \begin{pmatrix} 0 \\ 0 \end{pmatrix} + \frac 1 2 \begin{pmatrix} \bar X & \bar Y\end{pmatrix} \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} \bar X \\ \bar Y \end{pmatrix} \\
259-
\implies \bar X \bar Y &= 0 + \frac 1 2 \begin{pmatrix} \bar Y & \bar X\end{pmatrix} \begin{pmatrix} \bar X \\ \bar Y \end{pmatrix} = \bar X \bar Y
260+
&= \frac 1 2 \begin{pmatrix} \bar X & \bar Y\end{pmatrix} \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} \bar X \\ \bar Y \end{pmatrix} \\
261+
\implies nT &= \frac n 2 \begin{pmatrix} \bar X & \bar Y\end{pmatrix} \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} \bar X \\ \bar Y \end{pmatrix} \\
262+
&= \frac 1 2 \left( \sqrt n \begin{pmatrix} \bar X & \bar Y\end{pmatrix} \right) \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \left( \sqrt n \begin{pmatrix} \bar X \\ \bar Y \end{pmatrix} \right)
260263
\end{aligned}$$
261264

262265
So doing a Taylor expansion is not useful.

0 commit comments

Comments
 (0)