-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert site to bookdown format
- Loading branch information
Showing
453 changed files
with
41,368 additions
and
193,566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
title: "Notes for the Bayesian Data Analysis course" | ||
author: "Joshua Cook" | ||
description: "My notes and work for the Bayesian Data Analysis course taught by Aki Vehtari." | ||
book_filename: bookdown | ||
|
||
url: 'https://jhrcook.github.io/bayesian-data-analysis-course/' | ||
github-repo: 'hrcook/bayesian-data-analysis-course' | ||
twitter-handle: 'joshdoesa' | ||
|
||
date: "`r Sys.Date()`" | ||
|
||
documentclass: book | ||
new_session: yes | ||
delete_merged_file: true | ||
edit: https://github.com/jhrcook/bayesian-data-analysis-course/blob/master/%s | ||
view: https://github.com/jhrcook/bayesian-data-analysis-course/blob/master/%s | ||
|
||
before_chapter_script: ["src/globals.R"] | ||
|
||
output_dir: "docs" | ||
|
||
rmd_files: [ | ||
"index.Rmd", | ||
|
||
"notes-intro.Rmd", | ||
"notes-01_introduction_bda3-01.Rmd", | ||
"notes-02_basics-of-Bayesian-inference_bda3-02.Rmd", | ||
"notes-03_multidimensional-posterior_bda3-03.Rmd", | ||
"notes-04_monte-carlo_bda3-10.Rmd", | ||
"notes-05_mcmc_bda3-11.Rmd", | ||
"notes-06_hmc-nuts-stan_bda3-12.Rmd", | ||
"notes-07_hierarchical-models_bda3-5.Rmd", | ||
"notes-08_model-checking-and-cv_bda3-6-7.Rmd", | ||
"notes-09_model-selection_bda3-7.Rmd", | ||
"notes-10_decision-analysis_bda3-9.Rmd", | ||
"notes-11_normal-approx-freq-properties_bda3-04.Rmd", | ||
"notes-12_extended-topics.Rmd", | ||
"notes-13_intro-to-regression-models_bda3-14.Rmd", | ||
"notes-14_hierarchical-linear-models_bda3-15.Rmd", | ||
"notes-17_parametric-nonlinear-models_bda3-19.Rmd", | ||
"notes-18_basis-function-models_bda3-20.Rmd", | ||
"notes-19_gaussian-processes_bda3-21.Rmd", | ||
"notes-20_finite-mixture-models_bda3-22.Rmd", | ||
"notes-21_Dirichlet-process-models_bda3-23.Rmd", | ||
|
||
"assignment_intro.Rmd", | ||
"assignment-01.Rmd", | ||
"assignment-02.Rmd", | ||
"assignment-03.Rmd", | ||
"assignment-04.Rmd", | ||
"assignment-05.Rmd", | ||
"assignment-06.Rmd", | ||
"assignment-07.Rmd", | ||
"assignment-08.Rmd", | ||
"assignment-09.Rmd", | ||
|
||
"exercises_intro.Rmd", | ||
"exercises-01.Rmd", | ||
"exercises-02.Rmd", | ||
"exercises-07.Rmd", | ||
"exercises-19.Rmd", | ||
|
||
"stan_models.Rmd", | ||
|
||
"about.Rmd", | ||
"references.Rmd" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
library(glue) | ||
|
||
# ---- Configuration ---- | ||
|
||
# Directory contains the Stan models. | ||
MODELS_DIR <- file.path("models") | ||
# Name of the notebook to generate. | ||
OUTPUT_RMD_FILE <- file.path("stan_models.Rmd") | ||
|
||
# ---- | ||
|
||
stan_model_files <- list.files( | ||
MODELS_DIR, | ||
pattern = "stan$", | ||
full.names = TRUE, | ||
recursive = FALSE, | ||
ignore.case = TRUE | ||
) | ||
stan_model_files <- sort(stan_model_files) | ||
cat(glue("number Stan models: {length(stan_model_files)}"), "\n") | ||
|
||
stan_model_to_markdown <- function(model_file) { | ||
model_txt <- readLines(model_file) | ||
model_txt <- paste(model_txt, collapse = "\n") | ||
md_txt <- " | ||
## Model: `{basename(model_file)}` | ||
```stan | ||
{model_txt} | ||
``` | ||
" | ||
return(glue(md_txt)) | ||
} | ||
|
||
rmd_text <- "# (PART) Models {-} | ||
# Stan models | ||
Below are the Stan models built as a part of this course. | ||
The original files are available in the GitHub repo in the \"models\" directory. | ||
" | ||
|
||
for (mdl_file in stan_model_files) { | ||
model_md <- stan_model_to_markdown(mdl_file) | ||
rmd_text <- paste(rmd_text, model_md, sep = "\n") | ||
} | ||
|
||
rmd_text <- paste(rmd_text, "\n") | ||
writeLines(rmd_text, OUTPUT_RMD_FILE) | ||
cat(glue("output: {OUTPUT_RMD_FILE}"), "\n") |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
bookdown::gitbook: | ||
config: | ||
toc: | ||
collapse: section | ||
before: | | ||
<li><strong><a href="./">Notes for BDA3</a></strong></li> | ||
after: | | ||
<li><a href="https://github.com/rstudio/bookdown" target="_blank">Published with bookdown</a></li> | ||
search: | ||
engine: fuse | ||
edit: | ||
link: https://github.com/hadley/r4ds/edit/master/%s | ||
text: "Edit" | ||
sharing: | ||
github: true | ||
twitter: true | ||
facebook: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.