Model Outputs

Main Objectives

  • Understand the components of a jjm output object
  • Be able to make individual plots using the jjmR package
  • Be able to make custom plots using jjm model outputs

Output Files

Once you’ve successfully run the assessment model for h1 and h2, these are the files you should have (assuming you selected the pdf=TRUE option in the runit() function).

- h1_1.00_1_R.rep # Named report file that is read directly as a list into R
- h1_1.00.cor # Parameter correlation matrix
- h1_1.00.par # Best estimates of the parameters within the model
- h1_1.00.pdf # PDF of plots
- h1_1.00.rep # Predicted quantities
- h1_1.00.std # Estimated parameter values and standard deviations
- h1_1.00.yld # Profile of stock, yield, and recruitment over F

---

- h2_1.00_1_R.rep
- h2_1.00_2_R.rep # Note second R.rep file for the second stock
- h2_1.00.cor
- h2_1.00.par
- h2_1.00.pdf
- h2_1.00.rep
- h2_1.00.std
- h2_1.00.yld

The readJJM() function only requires a subset of these files to work:

- R.rep
- .par
- .rep
- .std
- .yld

Reading the Output into R

  • We have already most of this code for this in the Input Files doc.
library(jjmR)

h1.mod <- readJJM("h1_1.00", path = "config", input = "input")

h2.mod <- readJJM("h2_1.00",path = "config", input = "input")

names(h1.mod[[1]]$output[[1]])
  • These names correspond to values in the TPL file, so you can search that if you get stuck.

  • JC Quiroz wrote a script that pulls out quantities to make the tables in the technical annex (jjm/assessment/R/constructor_input_tables.R)

Things to Note

  • One of the most important tables (in my opinion) in the output object is msy_mt. It contains a matrix with the time series of derived quantities and estimated reference points.
    • Note to self: Set colnames in jjmR output function for this table
# // Yr Fspr 1-Fspr F/Fmsy Fmsy F Fsprmsy MSY MSYL Bmsy Bzero SSB B/Bmsy

h1.mod[[1]]$output[[1]]$msy_mt
  • FW_* denotes the Francis Weights for each fleet.
$FW_N_Chile
0.915323
$FW_SC_Chile_PS
0.910934
$FW_Offshore_Trawl
0.681234
$FW_Chile_AcousCS
0.92536
$FW_Chile_AcousN
0.91344
$FW_DEPM
1.07482
  • SSB_fut_1 to SSB_fut_5 denotes future spawning stock biomass projected under five different fishing scenarios (more on this later).

Making Plots

  • The PDF generated by runit() generally contains all the plots

  • The diagnostics function generates plots from the jjm object.

# Setting plot=T will create the entire suite of plots
h1.diag <- diagnostics(h1.mod, plot=F)

h2.diag <- diagnostics(h2.mod, plot=F)

#You can then plot individual plots by changing the `var` variable
plot(h1.diag, var = "fishedUnfishedBiomass")

plot(h2.diag, var = "summarySheet")
  • You can find the different var options deep within the jjmR code
    • Might be worth documenting separately?
  • Examples can also be found in jjm/assessment/R/AnnexPlots.R

Exercises

  • Pick two plots from the technical annex and make them from scratch
    • Find the variables using names(h1.mod[[1]]$output[[1]])
    • Do this for h1 and h2
    • Bonus if you can graph them creatively
  • Think of suggestions for other diagnostic plots we can use?