Skip to content

Commit

Permalink
add catch and survey comparison plots
Browse files Browse the repository at this point in the history
the LM was able to give nearly identical results
  • Loading branch information
mkapur-noaa committed Dec 27, 2023
1 parent 83820a0 commit 5dab933
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions docs/2024_bridging_analysis.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ toc: true
library(r4ss)
library(here)
library(dplyr)
library(ggplot2)
theme_set(afscassess::theme_report())
colvec <- c("dodgerblue4", "#ffb703","#219ebc", "#023047", "#fb8500")
year <- 2024
Expand Down Expand Up @@ -98,10 +101,10 @@ The figures at the bottom of this section compare the key data sources both hist

## Catch data

Both queries call from the `council.comprehensive_blend_ca` table. I ran the `afscassess::clean_catch()` function on the downloaded data, and the summary code for t
Both queries call from the `council.comprehensive_blend_ca` table. I ran the `afscassess::clean_catch()` function on the downloaded data, and the summary code for aggregating into TONS. The approaches result in consistent catch histories.

```{r load dfs include = FALSE, message = FALSE, warning = FALSE}
oldc <-
## Aggregate catch to just year
annual_catch <- read.csv(here(year,'data','raw','2023-12-19-catch.csv')) %>%
Expand All @@ -114,19 +117,41 @@ SS_catch <- data.frame(year=annual_catch$YEAR, seas=1, fleet=1,
catch=round(annual_catch$total), catch_se=round(0.01,2))
write.csv(x=SS_catch, file=here('data',paste0(Sys.Date(),'-SS_catch.csv') ), row.names=FALSE)
newc <- read.csv(here(year,'data','raw','fsh_catch_data.csv'))
dim(oldc)
dim(newc)
names(newc)
names(oldc)
rbind( mod_2020$catch %>% select(Yr, Obs) %>%
mutate(src = 'Old'),
read.csv(here(year,'data','output','fsh_catch_ss3.csv')) %>% mutate(src = 'New') %>% select(Yr = year, Obs = catch_t, src) ) %>%
ggplot(., aes(x = Yr, y = Obs, col = src )) +
geom_line() +
scale_color_manual(values = c('blue','grey22'),
labels = c('2024 Model Data', '2020 Model Data'))+
labs(x = 'Year', y = 'Observed Catch (t)', color = '')
```

## Survey Biomass Data
From the 2020 SAFE:
>"This assessment used a single survey index of "total" *Hippoglossoides* spp. biomass that included the EBS “standard” survey areas and AI survey areas for the years 1982-2018 (Table 9.9). Survey biomass for *Hippoglossoides* spp. in the Aleutian Islands is very small as compared to that from the EBS shelf survey, and survey biomass for Bering flounder is very small as compared to that of flathead sole. A linear regression is used to estimate a relationship between EBS shelf *Hippoglossoides* spp. survey biomass estimates and AI survey biomass estimates; this relationship is used to estimate AI survey biomass in years when no AI survey occurred (by using the linear equation to find an AI biomass estimate in a particular year based on the EBS biomass estimate for that year)."
Both Dr. Monnohan (per his notes) and I are not thrilled with this approach, since being model-based means that even historical datapoints can change with each new observation (assuming that the output of the lm is used to replace the survey biomass series wholesale, which would be statistically prudent).

I coded the linear model into the `afscdata::bsai_fhs` data extraction function and did *not* use the `afscassess::bts_biomass` function for further post-processing. The former function saves the Synthesis-formatted dataframe directly to `output/`. The resultant index is similar to what was used before.


```{r}
rbind( mod_2020$cpue %>% select(Yr, Obs, SE) %>%
mutate(src = 'Old'),
read.csv(here(year,'data','output','2023-12-19-ss_survey_index.csv')) %>% mutate(src = 'New') %>% select(Yr = year, Obs = obs, SE = se_log, src) ) %>%
ggplot(., aes(x = Yr, y = Obs, col = src )) +
geom_point(alpha = 0.2) +
geom_errorbar(aes(ymin = Obs - Obs*SE, ymax = Obs+Obs*SE), width = 0) +
scale_color_manual(values = c('blue','grey22'),
labels = c('2024 Model Data', '2020 Model Data'))+
labs(x = 'Year', y = 'Observed Survey Biomass (t)', color = '')
```

# Data Bridging
Importantly, the data updates conducted here are holistic, meaning that the entire time series of data for each component (where available) is replaced with what is currently available in the AKFIN database. A comparison of each data source is provided below. The model that includes each change is named in the relevant header; these are hosted under `model_runs/`.

Expand Down

0 comments on commit 5dab933

Please sign in to comment.