Skip to content

Commit

Permalink
deploy: 0bde7d9
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Aug 13, 2024
1 parent f207ca4 commit d2ea6fa
Show file tree
Hide file tree
Showing 95 changed files with 18,977 additions and 22,666 deletions.
1,975 changes: 414 additions & 1,561 deletions Aalto2023.html

Large diffs are not rendered by default.

1,952 changes: 400 additions & 1,552 deletions Aalto2024.html

Large diffs are not rendered by default.

2,282 changes: 655 additions & 1,627 deletions BDA3_notes.html

Large diffs are not rendered by default.

1,629 changes: 206 additions & 1,423 deletions FAQ.html

Large diffs are not rendered by default.

1,540 changes: 146 additions & 1,394 deletions assignments.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assignments/_freeze/assignment6/execute-results/html.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assignments/_freeze/assignment7/execute-results/html.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assignments/_freeze/assignment8/execute-results/html.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions assignments/_freeze/assignment9/execute-results/html.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions assignments/_freeze/simple_template3/execute-results/tex.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assignments/_freeze/template1/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"hash": "0ed9dcbcb2b9d3dd38dd58e0b8aa1a67",
"result": {
"markdown": "---\ntitle: \"Assignment 1\"\nauthor: anonymous # <-- hand in anonymously\nformat:\n html:\n toc: true\n code-tools: true\n code-line-numbers: true\n number-sections: true\n mainfont: Georgia, serif\n pdf:\n geometry:\n - left=1cm,top=1cm,bottom=1cm,right=7cm\n number-sections: true\n code-annotations: none\neditor: source\n---\n\n\n\n# General information\n\n:::: {.content-hidden when-format=\"pdf\"}\n::: {.callout-warning collapse=false}\n\n## Setup\n\n\n*This block will only be visible in your HTML output, but will be hidden when rendering to PDF with quarto for the submission.*\n**Make sure that this does not get displayed in the PDF!**\n \n\n\n\nThis is the template for [assignment 1](assignment1.html). You can download the [qmd-file](https://avehtari.github.io/BDA_course_Aalto/assignments/template1.qmd) or copy the code from this rendered document after clicking on `</> Code` in the top right corner.\n\n**Please replace the instructions in this template by your own text, explaining what you are doing in each exercise.**\n\nThe following will set-up `markmyassignment` to check your functions at the end of the notebook:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(markmyassignment)\nassignment_path = paste(\"https://github.com/avehtari/BDA_course_Aalto/\",\n\"blob/master/assignments/tests/assignment1.yml\", sep=\"\")\nset_assignment(assignment_path)\n```\n\n::: {.cell-output .cell-output-stderr}\n```\nAssignment set:\nassignment1: Bayesian Data Analysis: Assignment 1\nThe assignment contain the following (3) tasks:\n- p_red\n- p_box\n- p_identical_twin\n```\n:::\n:::\n\n\n:::\n::::\n\n\n# Basic probability theory notation and terms\n\nWrite your answers here!\n\n\n\n# Basic computer skills\n\nDo some setup here. Explain in text what you do.\n\n::: {.cell}\n\n```{.r .cell-code}\n# Do some setup:\ndistribution_mean = .2\ndistribution_variance = .01\n\n# You have to compute the parameters below from the given mean and variance\n# distribution_alpha = ...\n# distribution_beta = ...\n```\n:::\n\n\n\n\n## (a)\n\n\nPlot the PDF here. Explain in text what you do.\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: seq(), plot() and dbeta()\n```\n:::\n\n\n\n\n## (b)\n\n\nSample and plot the histogram here. Explain in text what you do.\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: rbeta() and hist()\n```\n:::\n\n\n\n\n## (c)\n\n\nCompute the sample mean and variance here. Explain in text what you do.\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: mean() and var()\n```\n:::\n\n\n\n\n## (d)\n\n\nCompute the central interval here. Explain in text what you do.\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: quantile()\n```\n:::\n\n\n\n# Bayes' theorem 1\n\n## (a)\n\n\nCompute the quantities needed to justify your recommendation here. Explain in text what you do.\nYou can do the computation with pen and paper or in R.\nEither way, you have to explain why you compute what you compute.\n\nIf you use pen and paper, you can include scans or pictures as follows (see also [assignment_instructions#fig-workflow](assignment_instructions#fig-workflow)):\n\n![Parts of Bayesian workflow](additional_files/bayes_workflow.jpg){#fig-workflow width=\"350\"}\n\nSee @fig-workflow for illustration of parts of Bayesian workflow.\n\n\n# Bayes' theorem 2\n\nYou will need to change the numbers to the numbers in the exercise.\n\n::: {.cell}\n\n```{.r .cell-code}\nboxes_test <- matrix(c(2,2,1,5,5,1), ncol = 2,\n dimnames = list(c(\"A\", \"B\", \"C\"), c(\"red\", \"white\")))\n```\n:::\n\n\n\n\n## (a)\n\n\nKeep the below name and format for the function to work with `markmyassignment`:\n\n::: {.cell}\n\n```{.r .cell-code}\np_red <- function(boxes) {\n # Do computation here, and return as below.\n # This is the correct return value for the test data provided above.\n 0.3928571\n}\n```\n:::\n\n\n\n\n## (b)\n\n\nKeep the below name and format for the function to work with `markmyassignment`:\n\n::: {.cell}\n\n```{.r .cell-code}\np_box <- function(boxes) {\n # Do computation here, and return as below.\n # This is the correct return value for the test data provided above.\n c(0.29090909,0.07272727,0.63636364)\n}\n```\n:::\n\n\n\n# Bayes' theorem 3\n\n## (a)\n\n\nYou will need to change the numbers to the numbers in the exercise.\n\n::: {.cell}\n\n```{.r .cell-code}\nfraternal_prob = 1/125\nidentical_prob = 1/300\n```\n:::\n\nKeep the below name and format for the function to work with `markmyassignment`:\n\n::: {.cell}\n\n```{.r .cell-code}\np_identical_twin <- function(fraternal_prob, identical_prob) {\n # Do computation here, and return as below.\n # This is the correct return value for the test data provided above.\n 0.4545455\n}\n```\n:::\n\n\n\n# The three steps of Bayesian data analysis\n\n## (a)\n\n\n:::: {.content-hidden when-format=\"pdf\"}\n::: {.callout-warning collapse=false}\n\n## markmyassignment\n\n\n*This block will only be visible in your HTML output, but will be hidden when rendering to PDF with quarto for the submission.*\n**Make sure that this does not get displayed in the PDF!**\n \n\n\nThe following will check the functions for which `markmyassignment` has been set up:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nmark_my_assignment()\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n✔ | F W S OK | Context\n\n⠏ | 0 | task-1-subtask-1-tests \n⠏ | 0 | p_red() \n✖ | 1 3 | p_red() [0.1s]\n────────────────────────────────────────────────────────────────────────────────\nFailure ('test-task-1-subtask-1-tests.R:21:3'): p_red()\np_red(boxes = boxes) not equivalent to 0.5.\n1/1 mismatches\n[1] 0.393 - 0.5 == -0.107\nError: Incorrect result for matrix(c(1,1,1,1,1,1), ncol = 2)\n────────────────────────────────────────────────────────────────────────────────\n\n⠏ | 0 | task-2-subtask-1-tests \n⠏ | 0 | p_box() \n✖ | 1 3 | p_box()\n────────────────────────────────────────────────────────────────────────────────\nFailure ('test-task-2-subtask-1-tests.R:19:3'): p_box()\np_box(boxes = boxes) not equivalent to c(0.4, 0.1, 0.5).\n3/3 mismatches (average diff: 0.0909)\n[1] 0.2909 - 0.4 == -0.1091\n[2] 0.0727 - 0.1 == -0.0273\n[3] 0.6364 - 0.5 == 0.1364\nError: Incorrect result for matrix(c(1,1,1,1,1,1), ncol = 2)\n────────────────────────────────────────────────────────────────────────────────\n\n⠏ | 0 | task-3-subtask-1-tests \n⠏ | 0 | p_identical_twin() \n✖ | 2 3 | p_identical_twin()\n────────────────────────────────────────────────────────────────────────────────\nFailure ('test-task-3-subtask-1-tests.R:16:3'): p_identical_twin()\np_identical_twin(fraternal_prob = 1/100, identical_prob = 1/500) not equivalent to 0.2857143.\n1/1 mismatches\n[1] 0.455 - 0.286 == 0.169\nError: Incorrect result for fraternal_prob = 1/100 and identical_prob = 1/500\n\nFailure ('test-task-3-subtask-1-tests.R:19:3'): p_identical_twin()\np_identical_twin(fraternal_prob = 1/10, identical_prob = 1/20) not equivalent to 0.5.\n1/1 mismatches\n[1] 0.455 - 0.5 == -0.0455\nError: Incorrect result for fraternal_prob = 1/10 and identical_prob = 1/20\n────────────────────────────────────────────────────────────────────────────────\n\n══ Results ═════════════════════════════════════════════════════════════════════\nDuration: 0.2 s\n\n[ FAIL 4 | WARN 0 | SKIP 0 | PASS 9 ]\n```\n:::\n:::\n\n\n:::\n::::\n\n",
"engine": "knitr",
"markdown": "---\ntitle: \"Assignment 1\"\nauthor: anonymous # <-- hand in anonymously\nformat:\n html:\n toc: true\n code-tools: true\n code-line-numbers: true\n number-sections: true\n mainfont: Georgia, serif\n pdf:\n geometry:\n - left=1cm,top=1cm,bottom=1cm,right=7cm\n number-sections: true\n code-annotations: none\neditor: source\n---\n\n\n\n\n\n\n\n# General information\n\n:::: {.content-hidden when-format=\"pdf\"}\n::: {.callout-warning collapse=false}\n\n## Setup\n\n\n*This block will only be visible in your HTML output, but will be hidden when rendering to PDF with quarto for the submission.*\n**Make sure that this does not get displayed in the PDF!**\n \n\n\n\nThis is the template for [assignment 1](assignment1.html). You can download the [qmd-file](https://avehtari.github.io/BDA_course_Aalto/assignments/template1.qmd) or copy the code from this rendered document after clicking on `</> Code` in the top right corner.\n\n**Please replace the instructions in this template by your own text, explaining what you are doing in each exercise.**\n\nThe following will set-up `markmyassignment` to check your functions at the end of the notebook:\n\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(markmyassignment)\nassignment_path = paste(\"https://github.com/avehtari/BDA_course_Aalto/\",\n\"blob/master/assignments/tests/assignment1.yml\", sep=\"\")\nset_assignment(assignment_path)\n```\n:::\n\n\n\n\n\n\n:::\n::::\n\n\n# Basic probability theory notation and terms\n\nWrite your answers here!\n\n\n\n# Basic computer skills\n\nDo some setup here. Explain in text what you do.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\n# Do some setup:\ndistribution_mean = .2\ndistribution_variance = .01\n\n# You have to compute the parameters below from the given mean and variance\n# distribution_alpha = ...\n# distribution_beta = ...\n```\n:::\n\n\n\n\n\n\n\n\n## (a)\n\n\nPlot the PDF here. Explain in text what you do.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: seq(), plot() and dbeta()\n```\n:::\n\n\n\n\n\n\n\n\n## (b)\n\n\nSample and plot the histogram here. Explain in text what you do.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: rbeta() and hist()\n```\n:::\n\n\n\n\n\n\n\n\n## (c)\n\n\nCompute the sample mean and variance here. Explain in text what you do.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: mean() and var()\n```\n:::\n\n\n\n\n\n\n\n\n## (d)\n\n\nCompute the central interval here. Explain in text what you do.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\n# Useful functions: quantile()\n```\n:::\n\n\n\n\n\n\n\n# Bayes' theorem 1\n\n## (a)\n\n\nCompute the quantities needed to justify your recommendation here. Explain in text what you do.\nYou can do the computation with pen and paper or in R.\nEither way, you have to explain why you compute what you compute.\n\nIf you use pen and paper, you can include scans or pictures as follows (see also [assignment_instructions#fig-workflow](assignment_instructions#fig-workflow)):\n\n![Parts of Bayesian workflow](additional_files/bayes_workflow.jpg){#fig-workflow width=\"350\"}\n\nSee @fig-workflow for illustration of parts of Bayesian workflow.\n\n\n# Bayes' theorem 2\n\nYou will need to change the numbers to the numbers in the exercise.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\nboxes_test <- matrix(c(2,2,1,5,5,1), ncol = 2,\n dimnames = list(c(\"A\", \"B\", \"C\"), c(\"red\", \"white\")))\n```\n:::\n\n\n\n\n\n\n\n\n## (a)\n\n\nKeep the below name and format for the function to work with `markmyassignment`:\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\np_red <- function(boxes) {\n # Do computation here, and return as below.\n # This is the correct return value for the test data provided above.\n 0.3928571\n}\n```\n:::\n\n\n\n\n\n\n\n\n## (b)\n\n\nKeep the below name and format for the function to work with `markmyassignment`:\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\np_box <- function(boxes) {\n # Do computation here, and return as below.\n # This is the correct return value for the test data provided above.\n c(0.29090909,0.07272727,0.63636364)\n}\n```\n:::\n\n\n\n\n\n\n\n# Bayes' theorem 3\n\n## (a)\n\n\nYou will need to change the numbers to the numbers in the exercise.\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\nfraternal_prob = 1/125\nidentical_prob = 1/300\n```\n:::\n\n\n\n\n\nKeep the below name and format for the function to work with `markmyassignment`:\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\np_identical_twin <- function(fraternal_prob, identical_prob) {\n # Do computation here, and return as below.\n # This is the correct return value for the test data provided above.\n 0.4545455\n}\n```\n:::\n\n\n\n\n\n\n\n# The three steps of Bayesian data analysis\n\n## (a)\n\n\n:::: {.content-hidden when-format=\"pdf\"}\n::: {.callout-warning collapse=false}\n\n## markmyassignment\n\n\n*This block will only be visible in your HTML output, but will be hidden when rendering to PDF with quarto for the submission.*\n**Make sure that this does not get displayed in the PDF!**\n \n\n\nThe following will check the functions for which `markmyassignment` has been set up:\n\n\n\n\n\n\n::: {.cell}\n\n```{.r .cell-code}\nmark_my_assignment()\n```\n:::\n\n\n\n\n\n\n:::\n::::\n\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
Expand Down
Loading

0 comments on commit d2ea6fa

Please sign in to comment.