--- title: "2. HCRs and MSEs: an introduction" author: "Grant Adams" output: rmarkdown::html_vignette vignette: > %\VignetteEngine{knitr::rmarkdown} %\VignetteIndexEntry{2. HCRs and MSEs: an introduction} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE ) ``` ## Fitting OMs An example MSE using the northern rockfish stock assessment. ```{r, message = FALSE, warning = FALSE,echo = TRUE} library(Rceattle) data("NorthernRockfish2022") nrdata <- NorthernRockfish2022 nrdata$fleet_control$proj_F_prop <- 1 om <- Rceattle::fit_mod( data_list = nrdata, estimateMode = 0, # Estimate initMode = 1, # Assume unfished equilibrium M1Fun = build_M1( M1_model = "sex_age_invariant", linkages = list( M1 = linkage_spec( formula = ~ 1, priors = list( "(Intercept)" = lognormal(log(0.06), 0.05) ) ) ) ), fit_control = fit_control(phase = TRUE) ) ``` ------------------------------------------------------------------------ ## Fitting EMs (Tier 3 HCR) We can use the `HCR = build_hcr()` argument in `fit_mod` to specify the HCR and BRPs of our management strategy. A variety of HCRs and BRPs are included and can be found by `?build_hcr`. ```{r, message = FALSE, echo = TRUE} em <- Rceattle::fit_mod( data_list = nrdata, estimateMode = 0, # Estimate initMode = 1, # Assume unfished equilibrium M1Fun = build_M1( M1_model = "sex_age_invariant", linkages = list( M1 = linkage_spec( formula = ~ 1, priors = list( "(Intercept)" = lognormal(log(0.06), 0.05) ) ) ) ), HCR = build_hcr(HCR = "NPFMC", # Tier3 HCR Ftarget = 0.4, # F40% Flimit = 0.35, # F35% Plimit = 0.2, # No fishing when SB dplyr::relocate(MSE), digits = 2) ```