{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "using Distributions, Turing, StatsPlots, Random, RDatasets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Assignment 3: model checking, evaluation, and comparison\n", "\n", "Students|\n", "-------|\n", "\n", "Name | Id\n", "------------|----------\n", "Ploni Almoni|123489589\n", "John Smith |923352302\n", "\n", "## Summary\n", "\n", "In this assignment we apply checking, evaluation, and comparison techniques to our models.. The assignment is based on the [class material](https://bgu-abda.bitbucket.io/#lectures): \n", "\n", "7. Model checking\n", "8. Model evaluation\n", "9. Regression models\n", "\n", "The assignment consists of two problems. Solve the problems in either Jupyter or Pluto notebook." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem 1: warp breaks\n", "\n", "Julia provides to [R datasets](https://www.rdocumentation.org/packages/datasets/versions/3.6.2) via package RDatasets. We will use the [warpbreaks](https://www.rdocumentation.org/packages/datasets/versions/3.6.2/topics/warpbreaks) dataset for this problem. You can load the dataset into data frame `df` as follows:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "df = RDatasets.dataset(\"datasets\", \"warpbreaks\");" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Infer the probability distribution of warp breaks for each of two wool types. Compare the results under separate and hierarchical models. Conduct two studies:\n", "\n", "1. Ignore warp tension and compare wool types based on all experiments. \n", "2. Account for warp tension in both the hierarchical model and the separate model.\n", "\n", "**Check, evaluate, and compare the models.**" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem 2. Reedfrog survival \n", "\n", "\n", "In class, we explored the data set for reedfrog survival experiment. We developed a simple hierarchical model based on the number of aquarium only, as well as a cross-classified model taking predation into account. \n", "\n", "1. Implement a linear regression model for the problem. Use population size, aquarium size, and predation as the explanatory variables, and the number of surviving reedfrogs as predicted variable.\n", "2. Check, compare, and evaluate the 3 models:\n", " * hierarchical model from lecture 5, based on aquarium only.\n", " * cross-classified hierarchical model from lecture 6, based on aquarium and predation.\n", " * regression model you have developed. \n", "\n", "NB: Use **cross-validation** for evaluation." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Julia 1.6.0", "language": "julia", "name": "julia-1.6" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }