-
Notifications
You must be signed in to change notification settings - Fork 1
/
parameter_tables_mauricio.Rmd
87 lines (62 loc) · 2.61 KB
/
parameter_tables_mauricio.Rmd
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
---
title: "parameter_tables_mauricio"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(kableExtra)
library(tidyverse)
```
```{r}
# Species:
# s = species, r, K, X, p
s1 <- c(s=1, r=0.2, K=100, X=50, p=20)
s2 <- c(s=2, r=0.2, K=100, X=50, p=20)
s3 <- c(s=3, r=0.2, K=100, X=50, p=20)
s4 <- c(s=4, r=0.2, K=100, X=50, p=40)
s5 <- c(s=5, r=0.2, K=100, X=50, p=40)
# t = tech, q1 = catchability species 1, q2 = catchability species 2...
t1 <- c(t=1, q1=0.04, q2=0.01, q3=0.01, q4=0.01, q5 = 0.1)
t2 <- c(t=2, q1=0.01, q2=0.04, q3=0.01, q4=0.01, q5 = 0.01)
t3 <- c(t=2, q1=0.01, q2=0.01, q3=0.04, q4=0.01, q5 = 0.01)
t4 <- c(t=2, q1=0.01, q2=0.01, q3=0.01, q4=0.04, q5 = 0.01)
t5 <- c(t=2, q1=0.01, q2=0.01, q3=0.01, q4=0.01, q5 = 0.04)
# Tech cost: t = tech, cost = cost per unit effort
c1 <- c(t=1, cost=1)
c2 <- c(t=2, cost=1)
c3 <- c(t=3, cost=1)
c4 <- c(t=4, cost=1)
c5 <- c(t=5, cost=1)
# Baskets: bimary matrix of # species x # baskets, where 1 means that species is in that basket
b1 <- c(s1 = 1, s2 = 0, s3 = 0, s4 = 0, s5 = 0)
b2 <- c(s1 = 0, s2 = 1, s3 = 0, s4 = 0, s5 = 0)
b3 <- c(s1 = 0, s2 = 0, s3 = 1, s4 = 0, s5 = 0)
b4 <- c(s1 = 0, s2 = 0, s3 = 0, s4 = 1, s5 = 0)
b5 <- c(s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 1)
# Quotas: position = basket, number is the harvest limit.
# We want this to be 0.1 of the preceding stock under constant mortality, so this will have to change to just input constant m.
mort_guess = c(0.2, 0.2, 0.2, 0.2, 0.2)
# Years
years = 30
```
```{r}
# Change these to reflect the number of species and technologies above:
species = list(s1, s2, s3, s4, s5)
tech = list(t1, t2, t3, t4, t5)
cost = list(c1, c2, c3, c4, c5)
baskets = list(b1, b2, b3, b4, b5)
```
```{r}
tech_df <- do.call(rbind, tech)
```
```{r}
species_df <- do.call(rbind, species)
kbl(species_df, caption = "Species Parameters for baskets based on price**NEEDS UPDATE", col.names = c("Species", "r", "K", "Starting stock", "Price", "Run 1", "Run 2", "Run 3")) %>%
kable_classic(full_width = F) %>%
column_spec(6, color = c("pink", "blue"))
add_header_above(c(" " = 5,"Basket grouping" = 3))
# save_kable(file = here("working_model", "scratch", "optim", "plots", "gd_sp_params.png"), zoom = 2)
kbl(tech_df, caption = "Technology matrix for analyzing every basket combination", col.names = c("Technology", "Catchability\n sp. 1", "Catchability\n sp. 2", "Catchability\n sp. 3", "Catchability\n sp. 4", "Catchability\n sp. 5"), escape = F) %>%
kable_classic(full_width = F) #%>%
#save_kable(file = here("working_model", "scratch", "optim", "plots", "gd_sp_params.png"), zoom = 2)
```