-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsummary.Rmd
143 lines (108 loc) · 3.09 KB
/
summary.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
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
140
141
142
---
title: "EBS pollock models"
author: "Ianelli"
output:
flexdashboard::flex_dashboard:
orientation: columns
social: menu
source_code: embed
vertical_layout: fill
theme:
version: 4
bootswatch: minty
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
library(flexdashboard)
library(plotly)
library(r4ss)
library(tidyverse)
library(here)
library(ggridges)
getwd()
loadup<-FALSE
if (loadup){
source("GetResults.R")
r1 <- ss_run<-SS_obj()
ra <- SS_obj(SS_output(dir = here("ss","noramp"),verbose=FALSE),src="noramp")
r2 <- SS_obj(SS_output(dir = here("ss","mod")),src="mod")
r3 <- SS_obj(SS_output(dir = here("ss","mix")),src="mix")
r4 <- SS_obj(SS_output(dir = here("ss","high")),src="high")
#r5 <- SS_obj(SS_output(dir = here("ss","autocor")),src="autocor")
ss_sel <- rbind(r1$sel,r2$sel,r3$sel,r4$sel)#,r5$sel)
#compute_matrix_summary(sel[,2:16])
gp_run<-gp_obj()
am_run<-AMAK_obj()
pm_run<-pm_obj()
load(here("SAM","poll23","run","model2.RData"))
sam_run <- SAM_obj()
all_sel <- rbind(sam_run$sel,pm_run$sel,am_run$sel,ss_run$sel,gp_run$sel)
all_ts <- rbind( sam_run$ts,pm_run$ts,am_run$ts,ss_run$ts,gp_run$ts)
} else {
load(here("compares.Rdata"))
}
```
Platforms
=======================================================================
Column {.tabset}
-----------------------------------------------------------------------
### Selectivity
```{r}
p<-Plot_Sel() + ggthemes::theme_few(base_size=11)
p
```
### Selectivity by age
```{r}
p <- Plot_Sel_age()
ggplotly(p)
```
### SSB
```{r}
p<- Plot_SSB()
ggplotly(p)
```
### Stock recruitment relationship
```{r}
p<- Plot_SRR()
ggplotly(p)
```
SS runs
=======================================================================
Column {.tabset}
-----------------------------------------------------------------------
### Run description
Runs with different selectivity assumptions where:
- **base**: selectivity at age allowed to vary (sigma penalty=0.7)
- **high**: selectivity at age constrained (sigma penalty=0.05)
- **mod**: selectivity at age moderately constrained (sigma penalty=0.4)
- **mix**: selectivity at age moderately constrained for middle ages, high for older ages, loose for younger ages
### Selectivity
```{r echo=FALSE}
ss_sel <- rbind(r1$sel,r2$sel,r3$sel,r4$sel)#,r5$sel)
p1 <- Plot_Sel(ss_sel)
p1
```
### Selectivity at age
```{r echo=FALSE}
p1 <- Plot_Sel_age(ss_sel)
ggplotly(p1)
```
### SSB and recruitment
```{r echo=FALSE}
ss_ts <- rbind(r1$ts,r2$ts,r3$ts,r4$ts)#,r5$sel)
p1 <- Plot_SSB(ss_ts)
ggplotly(p1)
```
With and w/o ramp
=======================================================================
### SSB and recruitment
```{r, echo=FALSE, warning=FALSE, message=FALSE}
# Get results w/ and w/o ramp
df <- rbind(r1$ts,ra$ts)
p1 <- df |> filter(Year<2024,Year>1953) |> ggplot(aes( x=Year, y= value,color=source)) +
geom_line(stat='identity') + geom_point(stat='identity') +
ggthemes::theme_few() + ylab("SSB") + xlab("Year") +
ylim(0,NA) + facet_grid(type~.,scales="free_y")
ggplotly(p1)
```