-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFigure3.Rmd
More file actions
86 lines (64 loc) · 1.83 KB
/
Figure3.Rmd
File metadata and controls
86 lines (64 loc) · 1.83 KB
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
---
title: "Figure 3"
subtitle: "A Probabilistic Synthesis of Malaria Epidemiology: Exposure, Infection, Parasite Densities, and Detection"
date: "`r format(Sys.time(), '%B %d, %Y')`"
author: John M. Henry, Austin R. Carter, Sean L. Wu, and David L. Smith
output:
html_document
---
`Figure3.Rmd`
***
[Home](Memory.html) |
[Fig 4](Figure4.html) |
[Fig 5](Figure5.html) |
[Fig 6](Figure6.html) |
[Fig 7](Figure7.html) |
[Fig 8](Figure8.html) |
[Fig 9](Figure9.html) |
[Fig 10](Figure10.html)
***
# {.tabset}
## $\odot$

## Setup
```{r}
library(ramp.falciparum)
library(viridisLite)
```
## Fig3a
```{r}
clrs = plasma(8)
par_t2 = par_type2Age()
a20yearsBy10days=seq(0, 7300, by=10)
wt1 = ageFoI(a20yearsBy10days, par_type2Age())
wt2 = ageFoI(a20yearsBy10days, par_flatAge())
```
```{r}
plot(a20yearsBy10days/365, wt1, type = "l", xlab = "Age in Years", ylab = expression(omega(a)), col = clrs[1])
lines(a20yearsBy10days/365, wt2, col = clrs[5])
```
## Fig3b
```{r}
p1 = par_expSeason(phase=-90, pwr=3.5, lift=0)
p2 = par_sinSeason(lift=-0.85, pwr=4, phase=0)
p3 = par_sinSeason(lift=0, pwr=4, phase=-90)
p4 = par_sinSeason(phase=-90)
p5 = par_flatSeason()
```
```{r}
oneYear = c(0:365)
plot(oneYear, seasonalFoI(oneYear, p1), type = "l", ylab = expression(S(t) - paste("Seasonal Pattern")), xlab = "Day of Year", col = clrs[1])
lines(oneYear, seasonalFoI(oneYear, p2), col = clrs[3], lwd=1.5)
lines(oneYear, seasonalFoI(oneYear, p3), col = clrs[5], lwd=1.5)
lines(oneYear, seasonalFoI(oneYear, p4), col = clrs[6], lwd=2)
lines(oneYear, seasonalFoI(oneYear, p5), col = grey(0.5), lwd=1.5)
```
## Remake
```{r, purl=F, eval=FALSE}
print("Making Figure 3")
purl("Figure3.Rmd", "Figure3.R")
png("Figure3.png", height= 320, width = 720)
par(mfrow = c(1,2))
source("Figure3.R")
invisible(dev.off(dev.cur()))
```