Skip to content

Commit

Permalink
swap to JuliaNotebookRunner backend
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Jun 27, 2024
1 parent 6582f75 commit beaf7ad
Show file tree
Hide file tree
Showing 27 changed files with 90 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ docs/site/
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
Manifest-v1.*.toml

/.quarto/
.CondaPkg/
Expand Down
3 changes: 3 additions & 0 deletions AoGPlots.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: "Creating multi-panel plots"
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

This notebook shows creating a multi-panel plot similar to Figure 2 of @Fuehner2021.
Expand Down
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@ SMLP2024: Advanced methods in frequentist statistics with Julia

The rendered website version of the course materials is available [here](https://repsychling.github.io/SMLP2024/).

This repository uses [Quarto](https://quarto.org). To be able to render all the pages, you will need an appropriate Jupyter kernel installed and the local environment instantiated.
This repository uses [Quarto](https://quarto.org) with the Julia code execution supplied by [QuartoNotebookRunner.jl](https://github.com/PumasAI/QuartoNotebookRunner.jl/), which requires Quarto 1.5+.

As of early May 2024, Quarto 1.5 is only available as a preview release, which you'll need to [download from GitHub](https://github.com/quarto-dev/quarto-cli/releases). Under each release's "Assets", you can find platform-specific installers.

```sh
~/SMLP2024$ julia
~/EmbraceUncertainty$ julia

julia> using Pkg

julia> Pkg.add("IJulia")
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
< lots of output >

julia> using IJulia

julia> installkernel("julia", "--threads=auto", "--project=@.")
[ Info: Installing julia kernelspec in ~/.local/share/jupyter/kernels/julia-1.9
"~/.local/share/jupyter/kernels/julia-1.9"

julia> Pkg.activate(".")
Activating project at `~/SMLP2024`

Expand All @@ -30,8 +21,7 @@ julia> Pkg.instantiate()

julia> exit()

~/SMLP2024$ quarto preview
~/EmbraceUncertainty$ quarto preview

< lots of output >

```
18 changes: 10 additions & 8 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
date: today
date-format: iso
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
execute:
cache: true
freeze: auto
number-sections: true

project:
type: website
title: "SMLP2024"
Expand Down Expand Up @@ -29,14 +39,6 @@ project:
- sleepstudy_speed.qmd
- useful_packages.qmd

date: today
date-format: iso
jupyter: julia-1.9
execute:
cache: true
freeze: auto
number-sections: true

# editor_options:
# chunk_output_type: console
filters:
Expand Down
4 changes: 3 additions & 1 deletion arrow.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "Saving data with Arrow"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

# The Arrow storage format
Expand Down
4 changes: 3 additions & 1 deletion bootstrap.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "Parametric bootstrap for mixed-effects models"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

The speed of MixedModels.jl relative to its predecessors makes the parametric bootstrap much more computationally tractable.
Expand Down
3 changes: 3 additions & 0 deletions check_emotikon_transform.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Transformed and original metrics in Emotikon
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

In @Fuehner2021 the original metric of two tasks (Star, S20) is time, but they were transformed to speed scores in the publication prior to computing z-scores.
Expand Down
4 changes: 3 additions & 1 deletion contrasts_fggk21.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "Mixed Models Tutorial: Contrast Coding"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
author: "Reinhold Kliegl"
---

Expand Down
4 changes: 3 additions & 1 deletion contrasts_kwdyz11.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Contrast Coding of Visual Attention Effects
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

```{julia}
Expand Down
4 changes: 3 additions & 1 deletion fggk21.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Basics with Emotikon Project
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

This script uses a subset of data reported in @Fuehner2021.
Expand Down
4 changes: 3 additions & 1 deletion glmm.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "Generalized linear mixed models"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

Load the packages to be used
Expand Down
3 changes: 3 additions & 0 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Seventh Summer School on Statistical Methods for Linguistics and Psychology"
subtitle: "Advanced methods in frequentist statistics with Julia"
author: "Phillip Alday, Reinhold Kliegl and Douglas Bates"
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

This site provides materials for the **Advanced frequentist methods** stream of the [Summer School on Statistical Methods](https://vasishth.github.io/smlp2024/) to be held at the University of Potsdam, 11-15 September, 2024.
Expand Down
4 changes: 3 additions & 1 deletion kb07.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "Bootstrapping a fitted model"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

Begin by loading the packages to be used.
Expand Down
4 changes: 3 additions & 1 deletion kkl15.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: 'RePsychLing Kliegl, Kuschela, & Laubrock (2015)- Reduction of Model Complexity'
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

# Background
Expand Down
4 changes: 3 additions & 1 deletion kwdyz11.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "RePsychLing Kliegl et al. (2011)"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
author: "Reinhold Kliegl"
---

Expand Down
4 changes: 3 additions & 1 deletion largescaledesigned.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

# A large-scale designed experiment {#sec-largescaledesigned}
Expand Down
4 changes: 3 additions & 1 deletion mrk17.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "RePsychLing Masson, Rabe, & Kliegl, 2017) with Julia: Specification and selection"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

# Setup
Expand Down
4 changes: 3 additions & 1 deletion partial_within.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "Partially-within subjects designs"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

Begin by loading the packages to be used.
Expand Down
3 changes: 3 additions & 0 deletions pkg.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: "Package management and reproducible environments"
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

*Julius Krumbiegel also has a [great blog post](https://jkrumbiegel.com/pages/2022-08-26-pkg-introduction/) with more details on Julia environments.*
Expand Down
4 changes: 3 additions & 1 deletion power_simulation.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Using simulation to estimate uncertainty and power"
subtitle: "Or how I learned how to stop worrying and love the bootstrap"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
format:
html:
embed-resources: true
Expand Down
3 changes: 3 additions & 0 deletions profiling.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: "Confidence intervals from profiled objective"
author: "Douglas Bates"
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

# Assessing the variability of parameter estimates
Expand Down
4 changes: 3 additions & 1 deletion selection.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

```{julia}
Expand Down
4 changes: 3 additions & 1 deletion shrinkageplot.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "More on shrinkage plots"
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

- I have stated that the likelihood criterion used to fit linear mixed-effects can be considered as balancing fidelity to the data (i.e. fits the observed data well) versus model complexity.
Expand Down
5 changes: 4 additions & 1 deletion singularity.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: "Convergence, singularity and all that"
author: "Douglas Bates"
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

## What does it mean for a converged model to be singular?
Expand Down Expand Up @@ -34,7 +37,7 @@ The covariance matrix for each subject's random effects is evaluated from its "m

```{julia}
λ = only(m01.λ)
```
```

The *transpose* of $\lambda$, written $\lambda'$, is an upper triangular matrix generated by "flipping" $\lambda$ about the main diagonal.

Expand Down
4 changes: 3 additions & 1 deletion sleepstudy.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Analysis of the sleepstudy data
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

The `sleepstudy` data are from a study of the effects of sleep deprivation on response time reported in @Balkin2000 and in @Belenky2003.
Expand Down
4 changes: 3 additions & 1 deletion sleepstudy_speed.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: "The sleepstudy: Speed - for a change ..."
jupyter: julia-1.9
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

# Background
Expand Down
5 changes: 4 additions & 1 deletion useful_packages.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: "Useful packages"
author: "Phillip Alday"
engine: julia
julia:
exeflags: ["--project", "--threads=auto"]
---

Unlike R, Julia does not immediately expose a huge number of functions, but instead requires loading packages (whether from the standard library or from the broader package ecosystem) for a lot of relevant functionality for statistical analysis.
Expand All @@ -14,7 +17,7 @@ This has two important implications:

This notebook is not intended to be an exhaustive list of packages, but rather to highlight a few packages that I suspect will be particularly useful.
Before getting onto the packages, I have one final hint: take advantage of how easy and first-class package management in Julia is.
Having good package management makes reproducible analyses much easier and avoids breaking old analyses when you start a new one.
Having good package management makes reproducible analyses much easier and avoids breaking old analyses when you start a new one.
The package-manager REPL mode (activated by typing `]` at the `julia>` prompt) is very useful.

# Data wrangling
Expand Down

0 comments on commit beaf7ad

Please sign in to comment.