-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorporate density-dependent growth
- Loading branch information
1 parent
f93123c
commit 5432c42
Showing
9 changed files
with
112 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: FLBEIA | ||
Title: Bio-Economic Impact Assessment of Management Strategies using FLR | ||
Version: 1.16.1.11 | ||
Date: 2023-03-07 | ||
Version: 1.16.1.13 | ||
Date: 22024-02-16 | ||
Authors@R: c(person("FLBEIA", "Team", email = "[email protected]", role = c("aut","cre"))) | ||
Description: A simulation toolbox that describes a fishery system under | ||
a Management Strategy Estrategy approach. The objective of the model is | ||
|
@@ -121,6 +121,7 @@ Collate: | |
"OM_1a_Population_Growth_Functions.R" | ||
"OM_1a1_Stock_Recruitment_functions.R" | ||
"OM_1a1_Stock_Recruitment_functions_segregmix.R" | ||
"OM_1a2_DensityDependent_weight_functions.R" | ||
"OM_2_fleet.om.R" | ||
"OM_2a_Effort_Dynamics.R" | ||
"OM_2a_Effort_Dynamics_Auxiliary.R" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#------------------------------------------------------------------------------- | ||
# DENSITY-DEPENDENT WEIGHT FUNCTIONS | ||
# | ||
# 14/02/2024 | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# REMARK: '...' in the arguments of the functions are necessary in order to be | ||
# generalist inside 'ASPG_DDW' function ('eval(call(...)'). | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
# Input variables from ASPG_DWW call: | ||
# biol = biol, stknm = stknm, year = year, season = season, ctrl = ddw.ctrl, covars = covars | ||
|
||
|
||
#------------------------------------------------------------------------------- | ||
# ddwAgeCa(biol, SR, fleets, biol.control) | ||
# - OUTPUT: list(wt = wage, wt.chg = wt.chg) - vector with estimated weight at age values and relative change | ||
#------------------------------------------------------------------------------- | ||
|
||
# Weights-at-age based on SSB and a covariate | ||
|
||
ddwAgeCa <- function(biol, stknm, year, season, ctrl, covars, ...) { | ||
|
||
pars <- ctrl$params[,,year,season,] # array[npar,nage,nyr,ns,nit] | ||
covnm <- ctrl$covnm # name of the covariate | ||
|
||
logssb <- log(ssb(biol)[,year,,season,drop=TRUE]) | ||
wage <- exp(pars["a",] + pars["b",] * logssb + pars["c",] * covars[[covnm]][stknm,year,,season,drop=TRUE]) | ||
|
||
# wt change | ||
wt.ref <- biol@wt[,year,,season,] | ||
wt.chg <- wage/wt.ref | ||
|
||
return(list(wt = wage, wt.chg = wt.chg)) | ||
|
||
} | ||
|
||
|
||
#------------------------------------------------------------------------------- | ||
# ddwAgeLFD(biol, SR, fleets, biol.control) | ||
# - OUTPUT: list(wt = wage, wt.chg = wt.chg) - vector with estimated weight at age values and relative change | ||
#------------------------------------------------------------------------------- | ||
|
||
# Weights-at-age based on SSB (linear model for estimating LW b parameter) and A LFD | ||
|
||
ddwAgeLFD <- function(biol, stknm, year, season, ctrl, covars, ...) { | ||
|
||
lfd <- ctrl[['LFD']] | ||
a <- ctrl[['a.lw']] | ||
lbins <- as.numeric(colNames(lfd)) | ||
|
||
B <- quantSums((biol@wt*biol@n)[,year-1])[drop=T] #! DG needs to consider season dimension | ||
|
||
condF <- predict(LW_lm, data.frame(biomass = B)) #! DG requires: biols.ctrl[[stknm]][['ddw.ctrl']][['LW_lm']] | ||
|
||
wy <- a*(lbins)^condF | ||
|
||
wt. <- rowSums(sweep(lfd, 2, wy, "*")) #! DG needs to consider also season dimension | ||
wt <- biol@wt[,year,,season,] | ||
|
||
return(list(wt = wt., wt.chg = wt./wt)) | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# FLBEIA | ||
- Version: 1.16.1.11 | ||
- Date: 2023-03-07 | ||
- Version: 1.16.1.13 | ||
- Date: 2024-02-16 | ||
- Author: Dorleta GARCIA <[email protected]>; FLBEIA Team <[email protected]> | ||
- Maintainer: Dorleta GARCIA, AZTI & FLBEIA Team | ||
- Repository: <https://github.com/flr/FLBEIA/> | ||
|