-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
139 lines (108 loc) · 10.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>EEB C119B C219B by kgostic</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">EEB C119B C219B</h1>
<h2 class="project-tagline">Resources for our course</h2>
<a href="https://github.com/kgostic/EEB_C119B_C219B" class="btn">View on GitHub</a>
<a href="https://github.com/kgostic/EEB_C119B_C219B/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/kgostic/EEB_C119B_C219B/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<h1>
<a id="welcome-to-my-ta-page-for-eeb-c119bc219b" class="anchor" href="#welcome-to-my-ta-page-for-eeb-c119bc219b" aria-hidden="true"><span class="octicon octicon-link"></span></a>Welcome to my TA page for EEB C119B/C219B</h1>
<p>Our discussion meets from 11-12 in TLSB 4000. Note that this time and locations differs from the official registrar listing. </p>
<p>My office hours are from 12-1 immediately following discussion. You can also schedule an appointment by email (<a href="mailto:[email protected]">[email protected]</a>)</p>
<h2>
<a id="week-1" class="anchor" href="#week-1" aria-hidden="true"><span class="octicon octicon-link"></span></a>Week 1</h2>
<h3>
<a id="r-resources" class="anchor" href="#r-resources" aria-hidden="true"><span class="octicon octicon-link"></span></a>R Resources</h3>
<ul>
<li>
<a href="http://cran.us.r-project.org/">Install R</a> </li>
<li>
<a href="https://www.rstudio.com/">Install R Studio</a>. R Studio is a free GUI (Graphical User Interface) for the R language that keeps things organized on your screen. You can run R without R Studio, but it’s a bit messy.</li>
<li>If you are new to R and/or programming, read through <a href="http://link.springer.com/book/10.1007/978-0-387-93837-0">A Beginner’s Guide to R</a>, Ch 1. After reading this chapter, you should be able to:
<ul>
<li>Understand what a package is</li>
<li>Install packages</li>
<li>Load packages</li>
<li>Understand what your working directory is</li>
<li>Change your working directory</li>
</ul>
</li>
<li>For resources that will help you learn to program in R, try:
<ul>
<li>Sections 1-4 and 6 of <a href="http://tryr.codeschool.com/">Try R code school</a>
</li>
<li>Chapters 1-6 of <a href="http://link.springer.com/book/10.1007/978-0-387-93837-0">A Beginner’s Guide to R</a>
</li>
</ul>
</li>
<li>For an introduction to ecological analyses, with supporting R code instructions, try:
<ul>
<li><a href="http://link.springer.com/book/10.1007/978-0-387-89882-7">A Primer of Ecology with R</a></li>
</ul>
</li>
</ul>
<h2>
<a id="week-2" class="anchor" href="#week-2" aria-hidden="true"><span class="octicon octicon-link"></span></a>Week 2</h2>
<h3>
<a id="solving-discrete-or-continuous-time-models" class="anchor" href="#solving-discrete-or-continuous-time-models" aria-hidden="true"><span class="octicon octicon-link"></span></a>Solving discrete and continuous time models in R</h3>
<ul>
<li>
<p>First, we will write a for loop in R as a warm up to solve discrete time models. In the geometric model, N(t+1) = rN(t). Open the following R script to see a for loop designed to solve the geometric model. <a href="https://github.com/kgostic/EEB_C119B_C219B/blob/gh-pages/For_loop_template.R">For loop template.</a> Try changing the initial population size or the population growth rate. Work through a few iterations of the calculation on your own to make sure the computer outputs match your expectations (start with a population size of 1, and use the value of r specified in your code) </p> </li>
<li>
Next, let's work through an exercise to convert the continuous time SIR model from last week to discrete time. <a href="https://github.com/kgostic/EEB_C119B_C219B/raw/gh-pages/Discussion2_Discreet_Continuous.pdf">Worksheet.</a> </p>
</li>
<li>
Now, take a moment to work through a script that uses a for loop to solve the discrete-time logistic model. <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Discrete_Time_Template.R">R template for discrete-time models.</a> </p>
</li>
<li>
Finally, work through this script, which uses an ODE solver, to solve the continuous time logistic model. <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Continuous_Time_Template.R">R template for continuous-time models with ODE solver.</a> </p>
</li>
<h3>
<a id="solving-discrete-or-continuous-time-models" class="anchor" href="#solving-discrete-or-continuous-time-models" aria-hidden="true"><span class="octicon octicon-link"></span></a>Discrete SIR Examples</h3>
<p> Here are two working example scripts for the discrete time SIR model. If you didn't have your scripts working by the end of discussion last week, you can check your work against these. </p>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Discrete_SIR_Example1.R">Example 1</a> uses a single matrix to store and plot the three state variables. </li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Discrete_SIR_Example2.R">Example 2</a> uses three vectors (SS, II, and RR) to store and plot the three state variables. </li>
<li>These scripts contain parameter values and initial populaiton sizes that return sensible results. A few of you noticed in class that different parameters and initial conditions could make your numbers of susceptibles go past 0 and into the negative range. This obviously doesn't make biological sense. Discrete time models are widely known to return this sort of odd behavior, which we wouldn't see in the analagous continuous time model. See this <a href="https://www.youtube.com/watch?v=bfMjdvQoUYA">3-minute video</a> if you're interested in understanding how complex dynamics like oscillations and chaos can arise in the discrete-time logistic model.</li>
<h2>
<a id="week-3" class="anchor" href="#week-3" aria-hidden="true"><span class="octicon octicon-link"></span></a>Week 3</h2>
<li> <a href="http://www.sciencedirect.com/science/article/pii/S0022519396902921"> This paper </a> explains the math behind the models we discussed today. See if you can understand the logic that connects a basic ODE model to the stochastic Markov model (which incorporates spatial structure.) </li>
<li> <a href="http://www.nature.com/nature/journal/v418/n6894/abs/nature00823.html"> This paper </a> proved that the theory in the first paper is true by predicting the dynamics of rocks-paper-scissors competition using computer simulations, and then reproducing the predicted dynamics using bacterial cultures in the lab. </li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Function_example.R">This is an R script with examples of basic functions.</a> You will need to understand functions to use the ODE solver in the next script. See p. 108 of <a href="http://link.springer.com/book/10.1007/978-0-387-93837-0">A Beginner’s Guide to R</a> for help.</li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Continuous_Time_Template.R"> Here is a template </a> that uses the ODE solver function "lsoda" to solve the logistic growth equation in continuous time. Modify the script to solve the SIR system of equations.</li>
<li> Finally, <a href="https://github.com/kgostic/EEB_C119B_C219B/raw/gh-pages/ModelFormulation_Discussion3.pdf"> here are my slides </a> </li>
<h2>
<a id="week-3" class="anchor" href="#week-3" aria-hidden="true"><span class="octicon octicon-link"></span></a>Code Templates</h2>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Discrete_SIR_Example1.R"> Discrete time ODE template </a> </li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Continuous_Time_Template.R"> Continuous time ODE template </a> </li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Cellular_Automaton.R"> Stochastic cellular automaton </a> </li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/For_loop_template.R"> For loop template </a> </li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Function_example.R"> Function template </a> </li>
<li> <a href="https://github.com/kgostic/EEB_C119B_C219B/blob/gh-pages/Discussion6_ParameterIntuition.pptx?raw=true"> Slides with parameterization help and debugging functions </a> </li>
<h2>
<a id="week-3" class="anchor" href="#week-3" aria-hidden="true"><span class="octicon octicon-link"></span></a>Plotting resources</h2>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Heatmap_RBaseGraphics.R"> Heat map template using R base graphics </a> </li>
<li> <a href="https://raw.githubusercontent.com/kgostic/EEB_C119B_C219B/gh-pages/Heatmap_ggplot.R"> Heat map template using ggplot </a> </li>
<li> <a href="http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf"> List of colors in R </a> </li>
<li> <a href="http://docs.ggplot2.org/current/index.html#"> ggplot documentation </a> </li>
<li> <a href="https://github.com/kgostic/EEB_C119B_C219B/raw/gh-pages/Plotting_Examples.pdf"> Script with plotting examples </a> </li>
<p> Remember, other code examples and tips are just a Google search away. Just specify that you want results in R, and (if you're using ggplot, include 'ggplot' in your search). </p>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/kgostic/EEB_C119B_C219B">EEB C119B C219B</a> is maintained by <a href="https://github.com/kgostic">kgostic</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>