Instructions: Submit this homework as a document. It can be entirely typed on a computer and uploaded on Blackboard, or completed as a combination of handwritten and printed (computer generated plots must be printed). Answer questions in complete sentences and explain how you obtained your answers. Only provide answers and include plots, do NOT send in code! Collaboration and discussion - openly and on the discussion forum - is highly encouraged, but do not provide and publicize actual answers.
This exercise is built directly off of the lab exercise from Thursday, March 31. The link to the lab is here. The lab contains links to the datasets and code.
Recall - the goal - essentially, was to recreate the following analysis by Gause:
The first thing you need to do is load the two datasets
single.csv
and micture.csv
into
R
, using using the FILE/IMPORT DATADET
point
and click or using the read.csv()
command
single <- read.csv("single.csv")
mixture <- read.csv("mixture.csv")
The single
dataset has data on the growth of two species
of paramecium: P. caudatum and P. aurelia separately.
The mixture
dataset has data from an experiment where
they’re both present.
The second thing you’ll need to do is open and run all the code in
the fittingfunctions.R
file.
Make plots of both datasets. One plot for the single
data, and one for the mixture
data, with two lines on each
plot.
The best way is using R
following the steps in the lab,
but you are welcome to do this in Excel or by hand or any other way you
like.
Use the fitLogistic()
function to fit a logistic curve
to each of the two single growth curves. Report the carrying capacity
and instrinsic growth curve for each of these.
Make a new plot of the data including a fitted line, using the
linesLogistic()
function.
The simulateCompetition()
function numerically generates
the 2 species competition process we discussed in class, i.e.:
\[{dN_1 \over dt} = r_1 N \left(1-{N_1 \over K_1} - \alpha {N_2\over K_1}\right)\] \[{dN_2 \over dt} = r_2 N \left(1-{N_2 \over K_2} - \beta { N_1\over K_2}\right)\]
And the getR2()
function quantifies the quality of that
fit, with 1 being a perfect fit.
3a) Following the instructions in the lab, see how good of a fit you can get of the competition model. Report estimates of \(K_1\), \(K_2\), \(r_1\), \(r_2\), \(\alpha\) and \(\beta\), and the final \(R^2\) value.
3b) Plot the fitted curves.
The isoclines of a two-species competition model are given by:
\[N^*_2 = K_2 - \beta N_1\] \[N^*_1 = K_1 - \alpha N_2\]
Plot these isoclines using the estimate of \(\alpha\) and \(\beta\) obtained from the fitted competiton
model. You can do this by hand, in Excel, or in R
. It is
relatively easy to draw straight lines in R
, using the
abline()
function - which takes an intercept and slope as
arguments. An example is below, drawing a red line with intercept 80 and
slope -1.5, and a blue line with intercept 40 and slope -0.5:
plot(0,0, xlim = c(0,100), ylim = c(0,100), xlab = "N1", ylab = "N2")
abline(80, -1.5, col = "red")
abline(40, -.5, col = "blue")
Based on analyzing isoclines, do you think that these two species of paramecium can coexist? If not - why not? If yes - at what levels?