In this repository we show how to reproduce the results in the paper "Incorporation of observation uncertainty in stock assessment using spatio-temporal modeling of catch-at-length and age-at-length survey data"
To estimate the index model and conduct the assessment, you first need to:
- Install the spatio-temporal index-at-length model available here: https://github.com/NorskRegnesentral/spatioTemporalIndices
- Install the spatio-temporal length-at-age model available here: https://github.com/NorskRegnesentral/spatioTemporalALK
- Install the state space assessment model SAM available here: https://github.com/fishfollower/SAM
Then the results can be reproduced with the following recipe:
- Run the script "scriptPaper/run.R" to estimate the index model and to generate the time series of abundance indices and covariance structures.
- Run the script "scriptPaper/runAssessment.R" to run the NEA haddock assessment with use of the indices and time series of covariance structures generated in the previous step.
- Run the script "scriptPaper/figuresGivenRun.R" to construct all tables and figures illustrating the index model.
- Run the script "scriptPaper/retroSTIM.R" and then the script "scriptpaper/retroSAM.R" to perform the retrospecitve analysis in the supplementary.
- Run the script "scriptPaper/validation.R" to conduct the simulation study and the jitter analysis in the supplementary.
- Run the script "scriptPaper/residuals.R" do construct the OSA residuals in the supplementary.
- Run the script "scriptPaper/variableSelectionLenght.R" and "scriptpaper/variableSelectionAge.R" to set up the AIC tables for combinations of covariates in the supplementary.
- Run the script "scriptPaper/sensitivityRuns.R" to run alternative models, e.g., with finer latent resolutions, discussed in the paper.
- Run the script "scriptPaper/runAssessmentAllSurveys.R" to generate the assessment results with all surveys available at the 2020 assessment.